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

Weight bias init update #96

Merged
merged 28 commits into from
Dec 10, 2018
Merged

Weight bias init update #96

merged 28 commits into from
Dec 10, 2018

Conversation

joemehltretter
Copy link
Contributor

@joemehltretter joemehltretter commented Nov 20, 2018

Fix #85
Created selu_init_ function to mimic pytorch's method for initializing with a normal distribution based on standard deviation of the number of input features. In DenseUnit and ConvUnit class when checking if activation is SELU set the initilizer to selu_int_ function and set bias_init to 0.0.

vulcanai2/models/layers.py Outdated Show resolved Hide resolved
vulcanai2/models/layers.py Outdated Show resolved Hide resolved
vulcanai2/models/layers.py Outdated Show resolved Hide resolved
vulcanai2/models/layers.py Outdated Show resolved Hide resolved
@rfratila
Copy link
Member

Also @joemehltretter please update all the documentation with regards to the initializer -> weight_init name change and at the init signatures

@joemehltretter
Copy link
Contributor Author

please also include the types to the parameters

@rfratila

@rfratila
Copy link
Member

Almost there @joemehltretter! Did you have some tests for these initializations?

vulcanai2/tests/models/test_layers.py Outdated Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Outdated Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Outdated Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Outdated Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Outdated Show resolved Hide resolved
vulcanai2/tests/models/test_layers.py Outdated Show resolved Hide resolved
@rfratila rfratila assigned rfratila and joemehltretter and unassigned rfratila Dec 10, 2018
@rfratila rfratila added ReviewReady enhancement New feature or request bug fix A stable patch for a previous bug labels Dec 10, 2018
vulcanai2/models/layers.py Show resolved Hide resolved
vulcanai2/models/layers.py Show resolved Hide resolved
@rfratila rfratila merged commit 749cf7f into master Dec 10, 2018
@rfratila rfratila deleted the weight_bias_init_update branch December 10, 2018 22:47
with torch.no_grad():
fan_in, _ = nn.init._calculate_fan_in_and_fan_out(tensor)
std = math.sqrt(1. / fan_in)
return nn.init.normal_(tensor, mean, std)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems identical to:
nn.init.kaiming_normal_(mode="fan_in", nonlinearity="linear")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jcowles that's a great find! If you would like to submit a PR to update this, that would be fantastic.

cc @nirtiac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix A stable patch for a previous bug enhancement New feature or request ReviewReady
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants