You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a doubt about deepnorm. In the paper, deepnorm_init function use xavier_normal_(x, gain=beta) for "ffn" "v_proj" "out_proj".
However, in the source code of torhscale use xavier_normal_(x, gain=1)/ beta:
`
for name, p in self.named_parameters():
if (
"fc1" in name
or "fc2" in name
or "out_proj" in name
or "v_proj" in name
):
p.data.mul_(init_scale)
`
Although i know that X ~ N(0,std^2), aX ~ N(0,(a*std)^2), I plot the distribution of both methods using a histogram,the results show some differences between the two methods:
@shumingma Ooooh! Sorry, I was careless to see mul as division, thank you for your correction!!! I understand deeper on deepnorm_init, and the corrected distribution is as follows:
I have a doubt about deepnorm. In the paper, deepnorm_init function use xavier_normal_(x, gain=beta) for "ffn" "v_proj" "out_proj".
However, in the source code of torhscale use xavier_normal_(x, gain=1)/ beta:
`
`
Although i know that X ~ N(0,std^2), aX ~ N(0,(a*std)^2), I plot the distribution of both methods using a histogram,the results show some differences between the two methods:
`
`
Is my implementation wrong? Which method should I use? I hope someone can enlighten me, thank you!!!
The text was updated successfully, but these errors were encountered: