zhihou7 / BatchFormer

CVPR2022, BatchFormer: Learning to Explore Sample Relationships for Robust Representation Learning, https://arxiv.org/abs/2203.01522
246 stars 20 forks source link

关于模型train阶段的问题 #6

Open mymuli opened 2 years ago

mymuli commented 2 years ago

您好! 我想问一下: Q1: 在模型训练的时候,模型最终是几个输出?是 BatchFormer前的classifier + BatchFormer后的classifier 这两个输出呢?然后分别与ground truth计算呢?

Q2: 代码里面,如下所示,这行代码表示的是BatchFormer后的classifier的输出呢?还是对模型两个classifier的输出做concat操作后,最后再与ground truth计算呢? https://github.com/zhihou7/BatchFormer/blob/f6be150ff9fce2ce4bcc3c0f8953dded9d4f273f/moco-v3/moco/builder.py#L23

zhihou7 commented 2 years ago

Sorry for getting you latter. A1: Yes, you can understand like that. A2: We can concat the two outputs of the classifier, and calculate the loss with the Ground Truth. Because the classifier is shared, we can thus directly concat the feature and duplicate the labels. Actually, we concat the feature between before BatchFormer and after BatchFormer.

By the way, for moco-v3, it is not necessary to use the two features according to our new experience.

yandun72 commented 1 year ago

really thanks for your reply,I understand it!thanks very much!