How can i control the init method of a layer like conv layer and fc layer?
how can i init a layer’s weights in a specific way?
How can i control the init method of a layer like conv layer and fc layer?
how can i init a layer’s weights in a specific way?
u can initialize layer this way
import scipy.stats as stats
stddev = 0.1
X = stats.truncnorm(-2, 2, scale=stddev)
values = torch.Tensor(X.rvs(layer.weight.data.numel()))
layer.weight.data.copy_(values)
or u can just simply fill 0
layer.weight.data._fill(0)
Thank you very much!