(net)
Init layer parameters.
Init layer parameters.
Init layer parameters .
def init_params(net):
    '''Init layer parameters.'''
    for m in net.modules():
        if isinstance(m, nn.Conv2d):
            init.kaiming_normal(m.weight, mode='fan_out')
            if m.bias:
                init.constant(m.bias, 0)
        elif isinstance(m, nn.BatchNorm2d):
            init.constant(m.weight, 1)
            init.constant(m.bias, 0)
        elif isinstance(m, nn.Linear):
            init.normal(m.weight, std=1e-3)
            if m.bias:
                init.constant(m.bias, 0)
def init_params ( net ) : for m in net . modules ( ) : if isinstance ( m , nn . Conv2d ) : init . kaiming_normal ( m . weight , mode = 'fan_out' ) if m . bias : init . constant ( m . bias , 0 ) elif isinstance ( m , nn . BatchNorm2d ) : init . constant ( m . weight , 1 ) init . constant ( m . bias , 0 ) elif isinstance ( m , nn . Linear ) : init . normal ( m . weight , std = 1e-3 ) if m . bias : init . constant ( m . bias , 0 )