-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
At forward of ArcMarginProduct.py
there is this code line:
if self.easy_margin:
phi = torch.where(cosine > 0, phi, cosine)
else:
phi = torch.where((cosine - self.th) > 0, phi, cosine - self.mm)
I understand if easy_margin is True, what operation is happening, but I can't understand What that line mean if easy_margin is False.
I understand easy_margin True like this:
if easy_margin True : if cosine(theta) is more than 90 degree, it doesn't add margin m and just use cosine(theta)
But when easy_margin False is too difficult to understand for me.
So can you explain what phi = torch.where((cosine - self.th) > 0, phi, cosine - self.mm) does mean?
reference:
self.th = math.cos(math.pi - m)
self.mm = math.sin(math.pi - m) * m
Metadata
Metadata
Assignees
Labels
No labels