I’m not terribly familiar with lstm autoencoders but just at a glance:
criterion = nn.BCEWithLogitsLoss() should be cross entropy.
Binary cross entropy is for binary classification (predicting 0 or 1).
remove this sigmoid, since crossentropy loss combines log_softmax with crossentropy.
decoded_output = self.sigmoid(decoded_output)
alternatively, you could use a log_softmax on your last layer and NLLoss.
http://pytorch.org/docs/0.3.1/nn.html#bcewithlogitsloss 17
http://pytorch.org/docs/0.3.1/nn.html#crossentropyloss 25