Insightface: And rational behind choosing the arc loss zy_keep value

Created on 14 Mar 2018  ·  3Comments  ·  Source: deepinsight/insightface

Hi, after reading the code, I didn't understand why the specific value zy_keep is chosen, could you help share some inghts here? thanks in advance!
https://github.com/deepinsight/insightface/blob/c9e5188ae289bef0e1a010e8f6846402d66be6c7/src/train_softmax.py#L227

mm = math.sin(math.pi-m)*m
...
zy_keep = zy - s*mm

Most helpful comment

image

@douhaoexia above figure, when m = 0.5 , as @nttstar said zy or zy_keep decreasing while theta in [0°,180°]

All 3 comments

To make the function cos(theta+m) monotonic decreasing while theta in [0°,180°]. But actually it's not necessary as theta will not go much larger than 90°.

Hello, I have some doubt.
From the code , I know when theta > threshold, ' cos(theta+m)' will be changed to zy_keep , namely 'cos(theta)-msin(m)'. The min of cos(theta+m) is -1 . To make the function monotonic decreasing while theta in [0°,180°] , we need to make sure ' cos(theta)-msin(m) < = -1' when ' theta > pi - m ' .
However, I can't prove 'cos(theta)-m*sin(m) < = -1' . Any problem about my analysis?

image

@douhaoexia above figure, when m = 0.5 , as @nttstar said zy or zy_keep decreasing while theta in [0°,180°]

Was this page helpful?
0 / 5 - 0 ratings