parameters: (model)
docstring: Reinitialize the Layer Weights for Sanity Checks.
docstring_summary: Reinitialize the Layer Weights for Sanity Checks.
docstring_tokens: Reinitialize the Layer Weights for Sanity Checks .
function: def reinitialize_layers(model):
      """ Reinitialize the Layer Weights for Sanity Checks.
      """
      def init_weights(m):
          if type(m) == nn.Linear:
              m.weight.data.fill_(0.3)
              if m.bias is not None:
                  m.bias.data.fill_(0.1)
          elif type(m) == nn.Embedding:
              m.weight.data.fill_(0.15)
          elif type(m) == nn.Dropout:
              nn.Dropout(DROPOUT_RATE)
      with torch.no_grad():
          model.apply(init_weights)
function_tokens: def reinitialize_layers ( model ) : def init_weights ( m ) : if type ( m ) == nn . Linear : m . weight . data . fill_ ( 0.3 ) if m . bias is not None : m . bias . data . fill_ ( 0.1 ) elif type ( m ) == nn . Embedding : m . weight . data . fill_ ( 0.15 ) elif type ( m ) == nn . Dropout : nn . Dropout ( DROPOUT_RATE ) with torch . no_grad ( ) : model . apply ( init_weights )