I have a trouble in customizing your code in to my project, in CombinedMarginLoss in target_logit computing.
https://github.com/deepinsight/insightface/blob/15396be41e4b885cbdd0e17b3018dedbbcfb28b0/recognition/arcface_torch/losses.py#L40
In my opinion, the positive samples so does the positive label index should be added a margin, so the target_logit shape should be the shape of [len(index_positive),len(index_positive)], so every positive dim in every positive samples could get a mrigin, but after print the shape of the target_logit during training, i found the shape of the target_logit is [len(index_positive)]
so, I guess the code of taeget_logit computing is as follows:
target_logit = logits[index_positive][:, labels[index_positive].view(-1)]
Thank you for your attention to this issue.
I have a trouble in customizing your code in to my project, in
CombinedMarginLoss
intarget_logit
computing. https://github.com/deepinsight/insightface/blob/15396be41e4b885cbdd0e17b3018dedbbcfb28b0/recognition/arcface_torch/losses.py#L40 In my opinion, the positive samples so does the positive label index should be added a margin, so thetarget_logit
shape should be the shape of[len(index_positive),len(index_positive)]
, so every positive dim in every positive samples could get a mrigin, but after print the shape of thetarget_logit
during training, i found the shape of thetarget_logit
is[len(index_positive)]
so, I guess the code oftaeget_logit
computing is as follows:target_logit = logits[index_positive][:, labels[index_positive].view(-1)]
Thank you for your attention to this issue.