Train.py
def init_weights(m):
    """
    Initialize weights of layers using Kaiming Normal (He et al.) as argument of "Apply" function of
    "nn.Module"

    :param m: Layer to initialize
    :return: None
    """

    if isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d):
        torch.nn.init.kaiming_normal_(m.weight, mode='fan_out')
        m.bias.data.fill_(0.0)
    elif isinstance(m, nn.BatchNorm2d):  # reference: https://github.com/pytorch/pytorch/issues/12259
        nn.init.constant_(m.weight, 1)
        nn.init.constant_(m.bias, 0)

    Initialize weights of layers using Kaiming Normal (He et al.) as argument of "Apply" function of
    "nn.Module"

    :param m: Layer to initialize
    :return: None
    
Initialize weights of layers using Kaiming Normal (He et al.) as argument of "Apply" function of
"nn.Module"
Initialize weights of layers using Kaiming Normal ( He et al . ) as argument of " Apply " function of " nn . Module "
def init_weights(m):
    if isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d):
        torch.nn.init.kaiming_normal_(m.weight, mode='fan_out')
        m.bias.data.fill_(0.0)
    elif isinstance(m, nn.BatchNorm2d):  
        nn.init.constant_(m.weight, 1)
        nn.init.constant_(m.bias, 0)
def init_weights ( m ) : if isinstance ( m , nn . Conv2d ) or isinstance ( m , nn . ConvTranspose2d ) : torch . nn . init . kaiming_normal_ ( m . weight , mode = 'fan_out' ) m . bias . data . fill_ ( 0.0 ) elif isinstance ( m , nn . BatchNorm2d ) : nn . init . constant_ ( m . weight , 1 ) nn . init . constant_ ( m . bias , 0 )
Initialize weights of layers using Kaiming Normal (He et al.)
Initialize weights of layers using Kaiming Normal ( He et al . )
"""
    Initialize weights of layers using Kaiming Normal (He et al.) as argument of "Apply" function of
    "nn.Module"

    :param m: Layer to initialize
    :return: None
    """ # reference: https://github.com/pytorch/pytorch/issues/12259
None
m
Layer to initialize
Layer to initialize