torch.init https://pytorch.org/docs/stable/nn.html#torch-nn-init
1. 均勻分布
torch.nn.init.uniform_(tensor, a=0, b=1)
服從~U(a,b)U(a, b)U(a,b)
2. 正太分布
torch.nn.init.normal_(tensor, mean=0, std=1)
服從~N(mean,std)N(mean, std)N(mean,std)
3. 初始化為常數
torch.nn.init.constant_(tensor, val)
初始化整個矩陣為常數val
4. Xavier
基本思想是通過網絡層時,輸入和輸出的方差相同,包括前向傳播和后向傳播,相關論文:Understanding the difficulty of training deep feedforward neural networks
其它具體參考:https://blog.csdn.net/dss_dssssd/article/details/83959474