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)[源代码]#
基类:
Module,CLFMixin,SizeMixin,DiffMixinStacked
LSTMmodel for sentiment analysis on theSent140dataset.The same as
RNN_Sent140but without the GloVe embedding layer. Hence the inputs of this model are embedd vectors.- 参数:
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[源代码]#
Forward pass.
- 参数:
embeds (torch.Tensor) -- Shape
(batch_size, seq_len, embedding_dim).- 返回:
Shape
(batch_size, num_classes).- 返回类型: