RNN_Sent140_LITE#
- class fl_sim.models.RNN_Sent140_LITE(latent_size: int = 100, num_classes: int = 2, num_layers: int = 2, embed_dim: int = 50)[source]#
Bases:
Module
,CLFMixin
,SizeMixin
,DiffMixin
Stacked
LSTM
model for sentiment analysis on theSent140
dataset.The same as
RNN_Sent140
but without the GloVe embedding layer. Hence the inputs of this model are embedd vectors.- Parameters:
latent_size (int, default 100) – The number of features in the hidden state h.
num_classes (int, default 2) – The number of output classes.
num_layers (int, default 2) – The number of recurrent layers (
torch.nn.LSTM
).embed_dim (int, default 50) – The dimension of the input embeddings.
- forward(embeds: Tensor) Tensor [source]#
Forward pass.
- Parameters:
embeds (torch.Tensor) – Shape
(batch_size, seq_len, embedding_dim)
.- Returns:
Shape
(batch_size, num_classes)
.- Return type: