Imported from https://github.com/wenhuchen/Variational-Vocabulary-Selection