Skip to content

An implementation of the Noise Contrastive Estimation algorithm for pyTorch. Working, yet not very efficient.

License

Notifications You must be signed in to change notification settings

summerqing/pyTorch_NCE

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyTorch_NCE

An implementation of the Noise Contrastive Estimation algorithm for pyTorch. Working, yet not very efficient. The code closely follows the TensorFlow NCE loss source code, with this being my attempt to adapt parts of it for pyTorch. Assumes the training data follows a Zipfian distribution, so this version is best used for training language models or word embeddings.

The following papers provide the necessary theoretical background:

Gutmann, Michael, and Aapo Hyvärinen. "Noise-contrastive estimation: A new estimation principle for unnormalized statistical models." AISTATS. Vol. 1. No. 2. 2010.

Mnih, Andriy, and Yee Whye Teh. "A fast and simple algorithm for training neural probabilistic language models." arXiv preprint arXiv:1206.6426 (2012).

About

An implementation of the Noise Contrastive Estimation algorithm for pyTorch. Working, yet not very efficient.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%