(self, hparams=None, **kwargs)
No additional parameters
No additional parameters
No additional parameters
def __init__(self, hparams=None, **kwargs):
        """
        No additional parameters
        """
        super(TransformerTagger, 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.transformer_char = transformer.Encoder(
                                        hparams.embedding_size_char,
                                        hparams.embedding_size_char_per_word,
                                        1,
                                        4,
                                        hparams.attention_key_channels,
                                        hparams.attention_value_channels,
                                        hparams.filter_size_char,
                                        hparams.max_length,
                                        hparams.input_dropout,
                                        hparams.dropout,
                                        hparams.attention_dropout,
                                        hparams.relu_dropout,
                                        use_mask=False
                                    ) 
            self.char_linear = nn.Linear(hparams.embedding_size_char_per_word, 1)

        self.transformer_enc = transformer.Encoder(
                                    embedding_size,
                                    hparams.hidden_size,
                                    hparams.num_hidden_layers,
                                    hparams.num_heads,
                                    hparams.attention_key_channels,
                                    hparams.attention_value_channels,
                                    hparams.filter_size,
                                    hparams.max_length,
                                    hparams.input_dropout,
                                    hparams.dropout,
                                    hparams.attention_dropout,
                                    hparams.relu_dropout,
                                    use_mask=False
                                )
def __init__ ( self , hparams = None , * * kwargs ) : super ( TransformerTagger , 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 . transformer_char = transformer . Encoder ( hparams . embedding_size_char , hparams . embedding_size_char_per_word , 1 , 4 , hparams . attention_key_channels , hparams . attention_value_channels , hparams . filter_size_char , hparams . max_length , hparams . input_dropout , hparams . dropout , hparams . attention_dropout , hparams . relu_dropout , use_mask = False ) self . char_linear = nn . Linear ( hparams . embedding_size_char_per_word , 1 ) self . transformer_enc = transformer . Encoder ( embedding_size , hparams . hidden_size , hparams . num_hidden_layers , hparams . num_heads , hparams . attention_key_channels , hparams . attention_value_channels , hparams . filter_size , hparams . max_length , hparams . input_dropout , hparams . dropout , hparams . attention_dropout , hparams . relu_dropout , use_mask = False )