Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

final_target_logit = torch.where(target_logit > self.threshold, cos_theta_m, target_logit - self.mm) #31

Open
powermano opened this issue Jul 28, 2021 · 1 comment

Comments

@powermano
Copy link

In MV-softmax, the released code use easy_margin like following:

final_gt = torch.where(gt > 0, cos_theta_m, gt)

but the official arcface implement does not use easy_margin, like following:

final_gt =  cos(θ + m)

I try mv-softmax using own dataset without easy_margin, but suffering from divergence issue(NAN). I fix divergence issue using easy_margin.

Compared with mv_softmax , there are two diffs, first is the thresh, CurricularFace use self.threshold = math.cos(math.pi - m), this is understandable, second is final_target_logit = torch.where(target_logit > self.threshold, cos_theta_m, target_logit - self.mm), what is intuitive understanding of target_logit - self.mm , where self.mm = math.sin(math.pi - m) * m

@lizhenstat
Copy link

Hi, same question here, did you find the meaning of self.mm later? Thanks a lot. @powermano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants