insightface
insightface copied to clipboard
Why is logic of ArcFace in the losses.py file different from the research paper?
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 -
- Why was this conditional statement added in the code when there is no mention of this logic in the research paper.
- What is the logic behind calculating
self.sinmmandself.theta