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

Added Weight Normalization #993

Closed
wants to merge 1 commit into from
Closed

Conversation

rajuthegr8
Copy link

No description provided.

@rajuthegr8
Copy link
Author

Added feature for #942 @MikeInnes @dhairyagandhi96

@rajuthegr8 rajuthegr8 requested a review from MikeInnes January 16, 2020 14:12
@CarloLucibello
Copy link
Member

It would nice to have a utility function to apply this to any module as pytorch does:
https://github.com/pytorch/pytorch/blob/master/torch/nn/utils/weight_norm.py
https://pytorch.org/docs/stable/nn.html#weight-norm

@bhvieira
Copy link
Contributor

bhvieira commented Jan 20, 2020

It would nice to have a utility function to apply this to any module as pytorch does:
https://github.com/pytorch/pytorch/blob/master/torch/nn/utils/weight_norm.py
https://pytorch.org/docs/stable/nn.html#weight-norm

I've been thinking of ways of doing that.
I think we could define an enclosure (like Chain) whose parameters are defined in the Weight Normalization fashion in regards to the parameters of its constituents.

Or we could do something with custom adjoints too, that's done explicitly in the paper.


Don't know what to do with the bias terms, however.

@bhvieira
Copy link
Contributor

I thought of a better way that mimics PyTorch, will write a PR soon.

@bhvieira
Copy link
Contributor

BTW in the paper the norm should be taken by output dimension, so g is a vector and v is a matrix.
Your current implementation equals to PyTorch with dim=None.

@bhvieira bhvieira mentioned this pull request Jan 25, 2020
3 tasks
@CarloLucibello
Copy link
Member

we need something more general, along the lines of #1005. Closing this now, feel free to open a new PR in case you want to tackle the problem again

@mcabbott mcabbott mentioned this pull request Sep 11, 2022
3 tasks
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

Successfully merging this pull request may close these issues.

3 participants