deepinsight / deepinsight/insightface

partial_fc_v2.py how does the backward work ,if margin_softmax is arcface

Open
#2,255 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/deepinsight/insightface/blob/master/recognition/arcface_torch/partial_fc_v2.py 165 rows
logits = self.margin_softmax(logits, labels)

there are many in_place operation . can the margin_softmax(arcface) backward ?
```
with torch.no_grad():
target_logit.arccos_()
logits.arccos_()
final_target_logit = target_logit + self.m2
logits[index_positive, labels[index_positive].view(-1)] = final_target_logit
logits.cos_()
logits = logits * self.s
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.