资源算法pyTorch_NCE

pyTorch_NCE

2019-09-19 | |  169 |   0 |   0

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. In case the built-in (Zipfian) sampler is used to obtain the ditractor items, the indices representing the data classes have to be sorted in the order of descending frequency, i.e. the index 0 should correspond to the most frequent word in the data.

The following papers provide the necessary theoretical background:

Gutmann, Michael, and Aapo Hyvrinen. "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).


上一篇:Ladder Network

下一篇:zalando-pytorch

用户评价
全部评价

热门资源

  • TensorFlow-Course

    This repository aims to provide simple and read...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • mxnet_VanillaCNN

    This is a mxnet implementation of the Vanilla C...

  • vsepp_tensorflow

    Improving Visual-Semantic Embeddings with Hard ...

  • DuReader_QANet_BiDAF

    Machine Reading Comprehension on DuReader Usin...