An issue about the default initialize methods.
See original GitHub issueHello, I’m training some custom models with ESPNet2. And I find that the default initialize method checking the bias parameters of NN by the p.dim()
function. This check is not precise (some parameters my also make p.dim() == 1
be True
) and set them to zero may lead to abnormal training. (I found one of my module always output zeros and the training may dead with ReLU. After removing the following lines, the training becomes OK. )
Issue Analytics
- State:
- Created a year ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Default initialization - cppreference.com
Default initialization is performed in three situations: 1) when a variable with automatic, static, or thread-local storage duration is declared ...
Read more >Problem of initialization in C++ - GeeksforGeeks
In this article, we will discuss the problem of initialization in C++, the data members of a class have private scope by default, ......
Read more >PSA: Don't initialize default values in Java - Google Groups
Whether or not we initialise default values I think the real problem is that calling a non-final method in a constructor gives non-intuitive ......
Read more >java - When is an interface with a default method initialized?
Before a class is initialized, its direct superclass must be initialized, but interfaces implemented by the class are not initialized. Similarly ...
Read more >Lint/UselessMethodDefinition marks empty `initialize ... - GitHub
Lint/UselessMethodDefinition marks empty initialize methods that take arguments as a violation even though they differ from the default ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
maybe make it case insensitive too just to be sure. This is difficult to implement in a scalable way. Current solution thus makes sense.
Maybe raising a warning also could be useful so user knows that the bias is set to zero. But warning should be likely raised once (e.g. for each layer of that class) otherwise will be too verbose maybe.
I found this issue has an impact on the most of TTS models since TTS modules is initialized using this method as a default. https://github.com/espnet/espnet/blob/14fcb2d42b2609f766ffaa7a79e9c921cd8398d9/espnet2/tts/fastspeech2/fastspeech2.py#L470-L475 https://github.com/espnet/espnet/blob/14fcb2d42b2609f766ffaa7a79e9c921cd8398d9/espnet2/tts/fastspeech2/fastspeech2.py#L828-L829
The model including
BatchNorm2d
orBatchNorm1d
modules should be improved with this changes. (I’m not sure what is happened before fixing this issue…)