Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

no_weight_decay_on_bn removes weight decay on FC #31

Closed
nagisa-eevee opened this issue Mar 8, 2022 · 1 comment
Closed

no_weight_decay_on_bn removes weight decay on FC #31

nagisa-eevee opened this issue Mar 8, 2022 · 1 comment

Comments

@nagisa-eevee
Copy link

I notice that if no_weight_decay_on_bn is set to True, weight decay will only apply to conv.weight. It seems that weight decay on fc layers are also removed at the same time. Is there any reason to do so?

@hysts
Copy link
Owner

hysts commented Mar 10, 2022

Hi, @nagisa-eevee

I think I added the option to try what's written in section 4.2 of this paper, and if I remember correctly, in my experiments, the accuracy was higher when no weight decay was applied to the fc layer. So that's the reason.
But the accuracy drop may be because I used the same parameter for weight decay on conv and fc layers, and tuning weight decay parameter on fc layer could lead to better accuracy. So in that sense, the current implementation that forces the weight decay on the fc layer to be 0 is not very good.

@hysts hysts closed this as completed Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants