I’m not sure what your underlying task is but your model might be off:

when you define self.lstm, input_size=((embedding_dim*vocab_size)+static_size) which is probably very large depending on vocab_size. Usually, input_size=embedding_dim

You push the data first through the LSTM layer and then through the Embedding layer. Usually, it’s done the other way around.

You might want to have a look at a working RNN classifier 16 of mine. The code only looks bloated because I make a lot configurable. The important parts are:


self.rnn = nn.LSTM(embedding_dim, self.rnn_hidden_dim, ...), i.e., the input_size of the LSTM layer is only the embedding_dim

In the forward method, I first push the sequence through the Embedding layer and then the LSTM layer