Replies: 1 comment
-
ArcFace contains parameters that need to be optimized. The parameters are used to convert embeddings into class predictions. You can use the same optimizer for your model and for the loss function if you want: optimizer = torch.optim.SGD(model.parameters() + loss_fn.parameters(), lr = 0.01)
# then during training:
loss = loss_fn(embeddings, labels)
optimizer.zero_grad()
loss.backward()
optimizer.step() ArcFace is a classification loss like A typical classification loss is applied like this: So the part that creates |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I wanted to understand why we require a separate optimizer for ArcFace specifically (and maybe other losses if the reason is generic) and is there code in the repo that corresponds to the use of a separate optimizer with these losses?
Beta Was this translation helpful? Give feedback.
All reactions