GithubHelp home page GithubHelp logo

--nce about pytorch-nce HOT 2 OPEN

stonesjtu avatar stonesjtu commented on August 23, 2024
--nce

from pytorch-nce.

Comments (2)

Stonesjtu avatar Stonesjtu commented on August 23, 2024

Hi Tony,
Thanks for reporting, Here are the line-by-line replies.

It looks like --nce has been replaced by --loss nce and README.md should be updated.

Yes

firstly is the warning from rnn.py,

Here we use single-layer RNN so drop-out config is dismissed. Should be fixed later

secondly the perplexities are all zero.

Something must be wrong

Moving on to NCE, the reported train PPL is very low, the valid PPL very high.

Since the loss criterion is different during NCE training and evalutation, which is (NCE vs Cross-Entropy). The training PPL is just the perplexity between the noise samples and positive samples, it should be, by definition, lower than real Perplexity within the whole vocabulary.

Looking forward to further discussion!

from pytorch-nce.

drtonyr avatar drtonyr commented on August 23, 2024

Hey, thanks for getting back to me so quickly.

I'm not really concerned about argparse or dropout issues. This is the best public code for NCE in Language Modelling I could find, that's a great achievement.

Zero perplexities is not something I can easily look into, and is quite a blocker for someone like me just starting with the code.

I can help with the reported PPL under NCE. Firstly, for large tasks, NCE will self-normalise. That is \sum exp(x_i) will be about 1. When this happens you can report approx standard perplexity during training (dev/test sets are much smaller, it's good to report exact PPL by normalising).

It has been ten years since I really got into this, I hope I haven't forgotten too much.

from pytorch-nce.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.