use correct initialisation in linear module#14034
Conversation
|
@soumith I'm not sure we can change the default initialization of linear, this might be too BC-breaking. Thoughts? |
|
I'm going to say that we are not going to change this. If you want to submit a doc patch suggesting the alternate initialization method, I'd be very happy to accept it. |
|
I’d say we should initialize bias to zeros. It is very standard and reasonable. We did a similar patch for BN recently. |
|
OK, reopening. |
fmassa
left a comment
There was a problem hiding this comment.
I have mixed feelings about changing the initialization. This is a backward-incompatible change and people's code might suffer performance change, which will be hard to catch.
From [this discussion](https://discuss.pytorch.org/t/whats-the-default-initialization-methods-for-layers/3157/17) it appears that the linear layer should be initialised according to (LeCun et al., 1998). However, LeCun et al. promote a variance of `1/n`, rather than a uniform distribution with bounds `1/n`! Also biases are generally initialised to be zero.
💊 CircleCI build failures summary and remediationsAs of commit f76098a:
Detailed failure analysisOne may explore the probable reasons each build failed interactively on the Dr. CI website. 🕵️ 2 new failures recognized by patternsThe following build failures don't appear to be due to upstream breakage:
|
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
From this discussion it appears that the linear layer should be initialised according to (LeCun et al., 1998). However, LeCun et al. promote a variance of
1/n, rather than a uniform distribution with bounds1/n! Also biases are generally expected to be initialised with zeros.