Closed ericyq closed 5 months ago
Hi @ericyq ~
In fact, we implemente the weighting of the ArcFace loss function in the partial_fc_exp.py file, as the backward propagation of the ArcFace loss is defined in this file. Please refer to "class PartialFCAdamW".
160th line, in train.py loss: torch.Tensor = module_partial_fc(local_embeddings, local_labels, opt, local_patch_entropy) here loss, isn't it not useful?
in addition, TopK tensor, is it not to used yet?
Actually, we use the loss function on the 190th line in train.py to optimize the model. We utilize TopK factors to guide the generalization of new samples (lines 158-191 in train.py).
TopK = TopK_ALL[:, :K] local_embeddings, weight, local_patch_entropy = backbone(img_fft) double loss: torch.Tensor = module_partial_fc(local_embeddings, local_labels, opt, local_patch_entropy)
above TopK tensor, weight,all not to used. 2 loss also was not used in combination.