Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i can't unserstand the batchformer code in RIDE-LongTailRecognition #4

Open
ToscanaGoGithub opened this issue Apr 15, 2022 · 5 comments

Comments

@ToscanaGoGithub
Copy link

Sorry to bother, I'm currently working on the long tail, so I'd like to find the general batchformer code for the long-tailed_recognition task. I can understand the batchformer code part in BalancedSoftmax. But in RIDE-LongTailRecognition, I can't understand what batchformer does, especially lines 137-150 under trainer.py, why is it self.add_bt in [32, 33]? Could you please explain?

@zhihou7
Copy link
Owner

zhihou7 commented Apr 15, 2022

Hi, thanks for your questions.

That's a redundant code. It is for debug and ablation studies. From line137-149, the code is actually similar to the code in line150. However, you can set a different loss weight for the stream with BatchFormer and without BatchFormer, which I think is similar to the strategy of reducing the learning rate or increasing weight decay for BatchFormer. Meanwhile, [32,33] includes a shared classifier. Anyway, you can regard this code as redundant and useless code.

The code might include some redundant codes, which show some attempts though we do not use them in the end. However, I think keeping the code might be helpful for readers to better understand the attempts.

By the way, In two-stage RIDE, we first train a model with only BatchFormer on frequent classes or rare classes (see

). Then, we train the model again with BatchFormer on all classes. WIth a simple attempt, we find distilling with the teacher model (more heads) does not improve the performance further. But we didn't dig it deep.

Feel free to contact me if you have further questions.

@ToscanaGoGithub
Copy link
Author

Thanks a lot for the reply! Your reply has solved my problem. This is a very good work, it is worth learning and learning, it may bother you again in the future, thank you again.

@zhihou7
Copy link
Owner

zhihou7 commented Apr 15, 2022

Feel free to post questions. Actually, I am also curious about BatchFormer and I am still working on a general version of BatchFormer. Please refer to BatchFormerV2

@ToscanaGoGithub
Copy link
Author

In fact, I have noticed that your BatchFormerV2 is very much looking forward to your work, a plug-and-play module is very worth looking forward to.

@zhihou7
Copy link
Owner

zhihou7 commented Apr 15, 2022

Thanks! It is really encouraging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants