(self, lstm_hidden_dim: int, da: int, r: int, vocab: Vocab)
Instantiating SentenceEncoder class

        Args:
            lstm_hidden_dim (int): the number of features in the hidden states in bi-directional lstm
            da (int): the number of features in hidden layer from self-attention
            r (int): the number of aspects of self-attention
            vocab (model.utils.Vocab): the instance of model.utils.Vocab
Instantiating SentenceEncoder class
Instantiating SentenceEncoder class
def __init__(self, lstm_hidden_dim: int, da: int, r: int, vocab: Vocab) -> None:
        """Instantiating SentenceEncoder class

        Args:
            lstm_hidden_dim (int): the number of features in the hidden states in bi-directional lstm
            da (int): the number of features in hidden layer from self-attention
            r (int): the number of aspects of self-attention
            vocab (model.utils.Vocab): the instance of model.utils.Vocab
        """
        super(SentenceEncoder, self).__init__()
        self._embedding = Embedding(
            vocab,
            padding_idx=vocab.to_indices(vocab.padding_token),
            freeze=False,
            permuting=False,
            tracking=True,
        )
        self._pipe = Linker(permuting=False)
        self._bilstm = BiLSTM(
            self._embedding._ops.embedding_dim, lstm_hidden_dim, using_sequence=True
        )
        self._attention = SelfAttention(2 * lstm_hidden_dim, da, r)
def __init__ ( self , lstm_hidden_dim : int , da : int , r : int , vocab : Vocab ) -> None : super ( SentenceEncoder , self ) . __init__ ( ) self . _embedding = Embedding ( vocab , padding_idx = vocab . to_indices ( vocab . padding_token ) , freeze = False , permuting = False , tracking = True , ) self . _pipe = Linker ( permuting = False ) self . _bilstm = BiLSTM ( self . _embedding . _ops . embedding_dim , lstm_hidden_dim , using_sequence = True ) self . _attention = SelfAttention ( 2 * lstm_hidden_dim , da , r )