Imported from https://github.com/cydonia999/variational-autoencoders-for-collaborative-filtering-pytorch