(self, hparams=None, **kwargs)
No additional parameters
No additional parameters
No additional parameters
def __init__(self, hparams=None, **kwargs):
        """
        No additional parameters
        """
        super(BiLSTMTagger, self).__init__(hparams=hparams, **kwargs)

        embedding_size = hparams.embedding_size_word
        if hparams.embedding_size_char > 0:
            embedding_size += hparams.embedding_size_char_per_word
            self.lstm_char = nn.LSTM(hparams.embedding_size_char, 
                                     hparams.embedding_size_char_per_word,
                                     num_layers=1, 
                                     batch_first=True, 
                                     bidirectional=False)


        self.lstm = nn.LSTM(embedding_size, 
                            hparams.hidden_size, 
                            num_layers=hparams.num_hidden_layers,
                            batch_first=True,
                            bidirectional=True
                           )

        self.dropout = nn.Dropout(hparams.dropout)
        self.extra_layer = nn.Linear(2*hparams.hidden_size, hparams.hidden_size)
def __init__ ( self , hparams = None , * * kwargs ) : super ( BiLSTMTagger , self ) . __init__ ( hparams = hparams , * * kwargs ) embedding_size = hparams . embedding_size_word if hparams . embedding_size_char > 0 : embedding_size += hparams . embedding_size_char_per_word self . lstm_char = nn . LSTM ( hparams . embedding_size_char , hparams . embedding_size_char_per_word , num_layers = 1 , batch_first = True , bidirectional = False ) self . lstm = nn . LSTM ( embedding_size , hparams . hidden_size , num_layers = hparams . num_hidden_layers , batch_first = True , bidirectional = True ) self . dropout = nn . Dropout ( hparams . dropout ) self . extra_layer = nn . Linear ( 2 * hparams . hidden_size , hparams . hidden_size )