Imported from https://github.com/matken11235/keras-seq2seq