megvii-research / BBN

The official PyTorch implementation of paper BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognition
https://arxiv.org/abs/1912.02413
MIT License
657 stars 100 forks source link

About the implementation of in the cumulative learning stage #25

Closed YTEP-ZHI closed 3 months ago

YTEP-ZHI commented 3 years ago

I'm confused about the implementation of fusing features from two branches. In the combiner.py of your code, it seems that features from two branchs are mixed by concatenating. (Related codes are as follows)

        mixed_feature = 2 * torch.cat((l * feature_a, (1-l) * feature_b), dim=1)
        output = model(mixed_feature, classifier_flag=True)
        loss = l * criterion(output, label_a) + (1 - l) * criterion(output, label_b)

However, in the section 4.1 of your paper, it's said that the two features are integrated by element-wise addition. image

Is the feature fusing conducted by concatenating or element-wise addition? Or am I misunderstanding anything?(Correct me if I'm wrong) Looking forward to your reply.

wangzhl1999 commented 3 months ago

The article and code are consistent, and the two classifiers are combined into one classifier in the code.

YTEP-ZHI commented 3 months ago

How time flies. It was posted almost three years ago.