(self, module)
initialize weights - note that nn.MultiheadAttention is already initalized by PyTorch (xavier_uniform)
initialize weights - note that nn.MultiheadAttention is already initalized by PyTorch (xavier_uniform)
initialize weights - note that nn . MultiheadAttention is already initalized by PyTorch ( xavier_uniform )
def init_weights(self, module):
        """ initialize weights - note that nn.MultiheadAttention is already initalized by PyTorch (xavier_uniform) """
        if isinstance(module, (nn.Linear, nn.Embedding, nn.LayerNorm)):
            module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
        if isinstance(module, (nn.Linear, nn.LayerNorm)) and module.bias is not None:
            module.bias.data.zero_()
def init_weights ( self , module ) : if isinstance ( module , ( nn . Linear , nn . Embedding , nn . LayerNorm ) ) : module . weight . data . normal_ ( mean = 0.0 , std = self . config . initializer_range ) if isinstance ( module , ( nn . Linear , nn . LayerNorm ) ) and module . bias is not None : module . bias . data . zero_ ( )