pytorch权重初始化之kaiming_normal初始化

import torch
import torch.nn as nn

w = torch.empty(2, 3)

# torch.nn.init.kaiming_normal_(tensor, a=0, mode='fan_in', nonlinearity='leaky_relu')
nn.init.kaiming_normal_(w, mode='fan_out', nonlinearity='relu')
# tensor([[ 0.2530, -0.4382,  1.5995],
#         [ 0.0544,  1.6392, -2.0752]])

https://www.aiuai.cn/aifarm613.html  mark

你可能感兴趣的:(深度学习)