I feel the issue is with



 Wesley_Neill:

self.cell = nn.LSTMCell(emb_size, emb_size)


which should be self.cell = nn.LSTMCell(n_features, emb_size).
I assume(!), looking at
3. Same pattern for other elements: x[i]= w.dot(hs[i]) + b 

that self.dense in your decoder converts the first hidden state into input. However, I can’t see what
x = torch.cat([x, x_i])

is doing.