source/models.py
def _initialize_weights(self):
        """ Initialize weights

        Private function to initialize weights. Executes once when ESPCN object is made.

        :return: None

        """

        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                if m.in_channels == 32:
                    nn.init.normal_(m.weight.data, mean=0.0, std=0.001)
                    nn.init.zeros_(m.bias.data)
                else:
                    nn.init.normal_(m.weight.data, mean=0.0, std=math.sqrt(2/(m.out_channels*m.weight.data[0][0].numel())))
                    nn.init.zeros_(m.bias.data)
 Initialize weights

        Private function to initialize weights. Executes once when ESPCN object is made.

        :return: None

        
Initialize weights
Private function to initialize weights. Executes once when ESPCN object is made.
Initialize weights Private function to initialize weights . Executes once when ESPCN object is made .
def _initialize_weights(self):
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                if m.in_channels == 32:
                    nn.init.normal_(m.weight.data, mean=0.0, std=0.001)
                    nn.init.zeros_(m.bias.data)
                else:
                    nn.init.normal_(m.weight.data, mean=0.0, std=math.sqrt(2/(m.out_channels*m.weight.data[0][0].numel())))
                    nn.init.zeros_(m.bias.data)
def _initialize_weights ( self ) : for m in self . modules ( ) : if isinstance ( m , nn . Conv2d ) : if m . in_channels == 32 : nn . init . normal_ ( m . weight . data , mean = 0.0 , std = 0.001 ) nn . init . zeros_ ( m . bias . data ) else : nn . init . normal_ ( m . weight . data , mean = 0.0 , std = math . sqrt ( 2 / ( m . out_channels * m . weight . data [ 0 ] [ 0 ] . numel ( ) ) ) ) nn . init . zeros_ ( m . bias . data )
Initialize weights
Private function to initialize weights.
Initialize weights Private function to initialize weights .
""" Initialize weights

        Private function to initialize weights. Executes once when ESPCN object is made.

        :return: None

        """
None
self