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

SNIP should calculate gradients on indicators/mask, not on weights #2

Open
iamanigeeit opened this issue Mar 15, 2022 · 0 comments
Open

Comments

@iamanigeeit
Copy link

iamanigeeit commented Mar 15, 2022

Hello,

Thanks for implementing in PyTorch, but i believe there is a something wrong in the code.

In the original paper and implementation, loss is differentiated against the connection indicators and not the weights.

image

From Lee's original code in line 67:
grads = tf.gradients(loss, [mask_init[k] for k in prn_keys])

I understand you have weight = indicator * weight before computing gradients, but i can't see where you extract the gradients for the indicators only. I see you've posted on the pytorch forum about this but nobody has answered properly.

@iamanigeeit iamanigeeit changed the title SNIP differentiates on indicators/mask, not on weights SNIP should differentiate on indicators/mask, not on weights Mar 15, 2022
@iamanigeeit iamanigeeit changed the title SNIP should differentiate on indicators/mask, not on weights SNIP should calculate gradients on indicators/mask, not on weights Mar 15, 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

1 participant