We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.0.4版本第26页处,您写道:
其实,在创建网络实例的过程中, 一旦调用 nn.Conv2d 的时候就会有对权值进行初始化 Conv2d 是继承_ConvNd,初始化赋值是在_ConvNd当中,这些值是创建一个 Tensor 时得到的,是一些很小的随机数。
实际上,并非如此,在pytorch源码中使用的是kaiming初始化,也就是说,pytorch的模型权值初始化不是很小的随机数。
参见: https://github.com/pytorch/pytorch/blob/6e453e56f991d43ff9d0eac715020b7ef877ca77/torch/nn/modules/conv.py#L43
https://github.com/pytorch/pytorch/blob/6e453e56f991d43ff9d0eac715020b7ef877ca77/torch/nn/modules/conv.py#L45
The text was updated successfully, but these errors were encountered:
您说的正确,我那里确实弄错了,默认初始值的设置是在_ConvNd类中的 --> self.reset_parameters() ---> def reset_parameters(self) ---> self.weight.data.uniform_(-stdv, stdv)
不过我发现我这个版本的pytorch采用的是均匀分布,不知从哪个版本之后修改成了kaiming初始化。如果以后有需要,就从 torch/nn/modules/conv.py 中 reset_parameters(self)函数去查找。
Sorry, something went wrong.
No branches or pull requests
0.0.4版本第26页处,您写道:
实际上,并非如此,在pytorch源码中使用的是kaiming初始化,也就是说,pytorch的模型权值初始化不是很小的随机数。
参见:
https://github.com/pytorch/pytorch/blob/6e453e56f991d43ff9d0eac715020b7ef877ca77/torch/nn/modules/conv.py#L43
https://github.com/pytorch/pytorch/blob/6e453e56f991d43ff9d0eac715020b7ef877ca77/torch/nn/modules/conv.py#L45
The text was updated successfully, but these errors were encountered: