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

Why the zeroed channels still receive gradients? #36

Open
AlexSunNik opened this issue Jul 20, 2023 · 1 comment
Open

Why the zeroed channels still receive gradients? #36

AlexSunNik opened this issue Jul 20, 2023 · 1 comment

Comments

@AlexSunNik
Copy link

Theoretically speaking, when you prune the channels according to the output dimension, you shouldn't get any gradient for the corresponding weights during your backward pass. How do you solve this from the code? Could you point me to the corresponding section?

I do notice that BN layers are not masked. If you keep the BN bias, there will indeed be gradients through the BN bias, but this seems like a very hacky workaround.

@lzd19981105
Copy link

When i use the scripts to prune the resnet20 on cifar10, the weights that are pruned do not receive gradients backward. That means the weights cannot be reconstructed. And also the BN bias. BN bias is set 0 at the begining, so the BN bias donot affect the output channel value when this channel is masked as zero.
This code cannot work as the paper it came from.

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