Imported from https://github.com/MJ-Jang/RNN_SVAE