├── .gitignore ├── LICENSE ├── README.md ├── example ├── data.py ├── data │ └── penn │ │ ├── test.txt │ │ ├── train.txt │ │ └── valid.txt ├── generic_model.py ├── log │ ├── ce.log │ ├── nr10.log │ ├── nr100.log │ └── nr500.log ├── main.py ├── model.py ├── requirements.txt ├── rescore.py ├── saved_model │ └── .keep ├── utils.py └── vocab.py ├── nce ├── __init__.py ├── alias_multinomial.py ├── index_gru.py ├── index_linear.py └── nce_loss.py ├── res └── alias.gif ├── sample.py ├── setup.cfg ├── setup.py └── test ├── test_evaluation.py └── test_perplexity.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/README.md -------------------------------------------------------------------------------- /example/data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/data.py -------------------------------------------------------------------------------- /example/data/penn/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/data/penn/test.txt -------------------------------------------------------------------------------- /example/data/penn/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/data/penn/train.txt -------------------------------------------------------------------------------- /example/data/penn/valid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/data/penn/valid.txt -------------------------------------------------------------------------------- /example/generic_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/generic_model.py -------------------------------------------------------------------------------- /example/log/ce.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/log/ce.log -------------------------------------------------------------------------------- /example/log/nr10.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/log/nr10.log -------------------------------------------------------------------------------- /example/log/nr100.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/log/nr100.log -------------------------------------------------------------------------------- /example/log/nr500.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/log/nr500.log -------------------------------------------------------------------------------- /example/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/main.py -------------------------------------------------------------------------------- /example/model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/model.py -------------------------------------------------------------------------------- /example/requirements.txt: -------------------------------------------------------------------------------- 1 | tqdm 2 | torch>=0.4.1 3 | dill 4 | -------------------------------------------------------------------------------- /example/rescore.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/rescore.py -------------------------------------------------------------------------------- /example/saved_model/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/utils.py -------------------------------------------------------------------------------- /example/vocab.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/example/vocab.py -------------------------------------------------------------------------------- /nce/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/nce/__init__.py -------------------------------------------------------------------------------- /nce/alias_multinomial.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/nce/alias_multinomial.py -------------------------------------------------------------------------------- /nce/index_gru.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/nce/index_gru.py -------------------------------------------------------------------------------- /nce/index_linear.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/nce/index_linear.py -------------------------------------------------------------------------------- /nce/nce_loss.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/nce/nce_loss.py -------------------------------------------------------------------------------- /res/alias.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/res/alias.gif -------------------------------------------------------------------------------- /sample.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/sample.py -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description-file = README.md 3 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/setup.py -------------------------------------------------------------------------------- /test/test_evaluation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/test/test_evaluation.py -------------------------------------------------------------------------------- /test/test_perplexity.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stonesjtu/Pytorch-NCE/HEAD/test/test_perplexity.py --------------------------------------------------------------------------------