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
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?

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