jagoul:

# Propagate input through LSTM
        ula, (output, _) = self.lstm(input, (hidden_state, cell_state))
        output = output.view(-1, self.hidden_size)

        out = self.dropout(out)
        output = self.fc(output)

        return output



I realize this is an old thread, but I stumbled on it and was wondering why are you taking what you call “output” above, and sending it through the network.  It looks like “output” is really h_n (the hidden state, don’t you really want to grab what you are calling “ula”?