Open
Conversation
sugarme
reviewed
Oct 15, 2023
| // | ||
| // Paper: https://proceedings.mlr.press/v9/glorot10a/glorot10a.pdf | ||
| // Pytorch implementation: https://github.com/pytorch/pytorch/blob/df50f91571891ec3f87977a2bdd4a2b609d70afc/torch/nn/init.py#L337 | ||
| func XavierNormal_(x *ts.Tensor, gainOpt ...float64) { |
Owner
There was a problem hiding this comment.
- We try to use Go conventional naming. If it's a unexposed function we can start with lowercase
xavierNormal() - There a placeholder for GolorotInit at . It would be great if you could fill in those things.
Line 300 in cd05657
- Try some unit test or example (make sure accuracy and no memory leak are the most priority as the function will be used everywhere (I often test result against Python in terms of accuracy).
Owner
|
Thanks for the PR. Please see my comments/wishes above. Would love to have this contribution. Please take your time. |
Author
|
Yes, I noticed that Glorot initialization needed to be implemented; and also I'm not quite sure if I should use lowercase because the xavier_uniform_ is defined as XavierUniform_ in the binding; but if you are referring to the glorotNInit, yes; I'll make sure to use lowercase. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, great work with this golang binding; I was translating my code for production but I saw the xavier_normal_ method was missing.
Hope this can help other people who had encountered this issue.