lib/model/couplenet/couplenet.py
def normal_init(m, mean, stddev, truncated=False):
            """
            weight initalizer: truncated normal and random normal.
            """
            # x is a parameter
            children_list = list(m.children())
            if len(children_list) > 0:
                m = children_list
            else:
                m = [m]

            for _m in m:
                if isinstance(_m, nn.Conv2d):
                    if truncated:
                        _m.weight.data.normal_().fmod_(2).mul_(stddev).add_(mean) # not a perfect approximation
                    else:
                        _m.weight.data.normal_(mean, stddev)
                        if _m.bias is not None:
                            _m.bias.data.zero_()

            weight initalizer: truncated normal and random normal.
            
weight initalizer: truncated normal and random normal.
weight initalizer : truncated normal and random normal .
def normal_init(m, mean, stddev, truncated=False):
            children_list = list(m.children())
            if len(children_list) > 0:
                m = children_list
            else:
                m = [m]
            for _m in m:
                if isinstance(_m, nn.Conv2d):
                    if truncated:
                        _m.weight.data.normal_().fmod_(2).mul_(stddev).add_(mean) 
                    else:
                        _m.weight.data.normal_(mean, stddev)
                        if _m.bias is not None:
                            _m.bias.data.zero_()
def normal_init ( m , mean , stddev , truncated = False ) : children_list = list ( m . children ( ) ) if len ( children_list ) > 0 : m = children_list else : m = [ m ] for _m in m : if isinstance ( _m , nn . Conv2d ) : if truncated : _m . weight . data . normal_ ( ) . fmod_ ( 2 ) . mul_ ( stddev ) . add_ ( mean ) else : _m . weight . data . normal_ ( mean , stddev ) if _m . bias is not None : _m . bias . data . zero_ ( )
weight initalizer: truncated normal and random normal.
weight initalizer : truncated normal and random normal .
"""
            weight initalizer: truncated normal and random normal.
            """ # x is a parameter # not a perfect approximation
m
mean
stddev
truncated