gluon-nlp icon indicating copy to clipboard operation
gluon-nlp copied to clipboard

[Bug Fix] trainer.update(1) should be used after loss.mean() is called

Open liuzh47 opened this issue 5 years ago • 9 comments

Description

(Brief description on what this PR is about) [BUGFIX] A bug fix of sentiment analysis training script. trainer.update(1) should be used after loss.mean() is called.

Checklist

Essentials

  • [ X] PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
  • [ X] Changes are complete (i.e. I finished coding on this PR)
  • [ X] All changes have test coverage
  • [ X] Code is well-documented

Changes

  • [ ] Feature1, tests, (and when applicable, API doc)
  • [ ] Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

cc @dmlc/gluon-nlp-team

liuzh47 avatar Nov 12 '19 10:11 liuzh47

Codecov Report

Merging #1000 into v0.x will decrease coverage by 2.55%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             v0.x    #1000      +/-   ##
==========================================
- Coverage   87.26%   84.70%   -2.56%     
==========================================
  Files          81       43      -38     
  Lines        7371     6701     -670     
==========================================
- Hits         6432     5676     -756     
- Misses        939     1025      +86     
Impacted Files Coverage Δ
conftest.py 85.29% <100.00%> (ø)
src/gluonnlp/data/sampler.py 96.55% <0.00%> (-0.27%) :arrow_down:
src/gluonnlp/utils/__init__.py 100.00% <0.00%> (ø)
src/gluonnlp/data/bert/squad.py
src/gluonnlp/model/utils.py
src/gluonnlp/data/conll.py
src/gluonnlp/data/word_embedding_evaluation.py
src/gluonnlp/calibration/collector.py
src/gluonnlp/data/registry.py
src/gluonnlp/embedding/evaluation.py
... and 109 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c99061d...189bbdc. Read the comment docs.

codecov[bot] avatar Nov 12 '19 10:11 codecov[bot]

Job PR-1000/2 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-1000/2/index.html

mli avatar Nov 13 '19 03:11 mli

@astonzhang FYI

The results at https://github.com/dmlc/gluon-nlp/blob/master/scripts/sentiment_analysis/index.rst#textcnn are generated without this change. Could you confirm (on a sample) that the results remain unchanged?

leezu avatar Nov 13 '19 03:11 leezu

Job PR-1000/4 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-1000/4/index.html

mli avatar Nov 14 '19 04:11 mli

I will reconfirm the results on all sample.

xiaotinghe avatar Nov 17 '19 07:11 xiaotinghe

@xiaotinghe any update?

szha avatar Dec 10 '19 01:12 szha

@szha @eric-haibin-lin I have reconfirmed the results for all the data. I will update the results later.

xiaotinghe avatar Dec 11 '19 11:12 xiaotinghe

Ping @xiaotinghe

leezu avatar Feb 10 '20 18:02 leezu

@liuzh91 I tried changing the base to master and got this error message: There are no new commits between base branch 'master' and head branch 'master'. It might be easier to close this one and create a new branch and PR

szha avatar Sep 01 '20 19:09 szha