Closed mathpopo closed 5 years ago
def msr_init(net): '''Initialize layer parameters.''' for layer in net: if type(layer) == nn.Conv2d: n = layer.kernel_size[0]layer.kernel_size[1]layer.outchannels layer.weight.data.normal(0, math.sqrt(2./n)) layer.bias.data.zero() elif type(layer) == nn.BatchNorm2d: layer.weight.data.fill(1) layer.bias.data.zero() elif type(layer) == nn.Linear: layer.bias.data.zero()
_, term_width = os.popen('stty size', 'r').read().split()-------
os.popen not enough values to unpack
def msr_init(net): '''Initialize layer parameters.''' for layer in net: if type(layer) == nn.Conv2d: n = layer.kernel_size[0]layer.kernel_size[1]layer.outchannels layer.weight.data.normal(0, math.sqrt(2./n)) layer.bias.data.zero() elif type(layer) == nn.BatchNorm2d: layer.weight.data.fill(1) layer.bias.data.zero() elif type(layer) == nn.Linear: layer.bias.data.zero()
_, term_width = os.popen('stty size', 'r').read().split()-------
os.popen not enough values to unpack