wy1iu / sphereface

Implementation for <SphereFace: Deep Hypersphere Embedding for Face Recognition> in CVPR'17.
MIT License
1.58k stars 543 forks source link

question about formula derivation #44

Open xizi opened 7 years ago

xizi commented 7 years ago

Hi, @wy1iu, sphereface is quite a great work and i have some questions about the formula derivation in margin_inner_product_layer. Such as in "margin_inner_product_layer.hpp" file, why set "sign_0 = sign(cos_theta)", "sign_1 = sign(abs(cos_theta) - 0.5)", "sign_2 = sign_0 (1 + sign_1) - 2", "sign_3 = sign_0 sign(2 cos_thetaquadratic - 1)", "sign_4 = 2 sign_0 + sign_3 - 3". If i want get a pent type, what variables "sign_5" should i set.

gobigrassland commented 6 years ago

I have same questions,too. why multiply sign_0 in "|x| (2 sign_0 * cos_theta_quadratic - 1)"