Joker316701882 / Additive-Margin-Softmax

This is the implementation of paper <Additive Margin Softmax for Face Verification>
492 stars 149 forks source link

about cos_theta #2

Closed alexliyang closed 6 years ago

alexliyang commented 6 years ago

Hi : I have question : in order to get the cos_theta , here tf.matmul is used, when I train a net, "nan" log is showed, so I confused, tf.matmul get a matrix result, tf.multiply get a scalar value. Can I use tf.multiply here ?

Joker316701882 commented 6 years ago

@alexliyang Use tf.multiply will need one or two more lines to implement this. But there is no need and no reason to use tf.multiply. There must be other problems cause u get "nan" value but not tf.matmul : )

alexliyang commented 6 years ago

thank you very much! I reference your code to write arcface (insightface) loss function. I correct some errors and start trainning . I hope 'nan' log disappered.

Joker316701882 commented 6 years ago

@alexliyang Oh great! I also tried Arcface once, and failed to converge. Looking forward to your progress on that : )

alexliyang commented 6 years ago

in fact, we try to use AM (mobilenet, tf), but the converge is very slow and acc is not good, only about 0.74 . we can not understand where the error is .

Joker316701882 commented 6 years ago

@alexliyang See Issue, there are some useful tips in it, hope it helps u.

alexliyang commented 6 years ago

Thank you ! we try .