insightface icon indicating copy to clipboard operation
insightface copied to clipboard

Why is logic of ArcFace in the losses.py file different from the research paper?

Open suryakiran1006 opened this issue 3 years ago • 0 comments

In the forward function, we have the following logic -

if self.easy_margin:
  final_target_logit = torch.where(target_logit > 0, cos_theta_m, target_logit)
else:
  final_target_logit = torch.where(target_logit > self.theta, cos_theta_m, target_logit - self.sinmm)

From what I understand, this logic is meant to calculate the final_target_logit that is used to compute the loss function. I have two questions here -

  1. Why was this conditional statement added in the code when there is no mention of this logic in the research paper.
  2. What is the logic behind calculating self.sinmm and self.theta

suryakiran1006 avatar Jun 12 '22 13:06 suryakiran1006