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

Remove global average pooling out of "forward_head" #9

Open
abcsimple opened this issue May 18, 2023 · 1 comment
Open

Remove global average pooling out of "forward_head" #9

abcsimple opened this issue May 18, 2023 · 1 comment

Comments

@abcsimple
Copy link

Great job on your work! I have a small suggestion regarding the code in inceptionnext.py. It would be more convenient if the line "x = x.mean((2, 3)) # global average pooling" was moved from the "self.forward_head" function to the end of the "self.forward_features" function. This way, we can directly command the line "x = self.forward_head(x)" when we have our own classification layer, without needing to keep the "MlpHead" class and command the lines after "x = x.mean((2, 3)) # global average pooling". The current setup is a little inconvenient.

@yuweihao
Copy link
Collaborator

Hi @abcsimple ,

Thanks for your suggestion. This repo is based on timm, and timm also merges the global average pooling into the classifier, see timm's classifier.py. The current implementation may help it to match the code style of timm.

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