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

target model optimizer in DA #4

Closed
chenxi52 opened this issue Jan 7, 2022 · 1 comment
Closed

target model optimizer in DA #4

chenxi52 opened this issue Jan 7, 2022 · 1 comment

Comments

@chenxi52
Copy link

chenxi52 commented Jan 7, 2022

optimizer_T in train_DA.py of 'SHOT' method only optimizes net_T.base.parameters() without net_T.bottleneck ,but function train_net_T() in da_trainer.py sets self.net_T.bottleneck.train() mode. Don't they conflicts with each other?

@hou-yz
Copy link
Owner

hou-yz commented Jan 7, 2022

thank you for your question.

no, they do not.

please see pytorch documents for how optimizer and the .train() call work. in short, optimizer updates parameters (please go see the definition of parameters); while the .train() call allows certain stuff like statistics in BN layers (not included in parameters) to be updated, and changes behaviors of certain layers like dropout.

Best,
Yunzhong

@hou-yz hou-yz closed this as completed Jan 7, 2022
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