gluon-nlp
gluon-nlp copied to clipboard
[Bug Fix] trainer.update(1) should be used after loss.mean() is called
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
Codecov Report
Merging #1000 into v0.x will decrease coverage by
2.55%
. The diff coverage is100.00%
.
@@ 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.
Job PR-1000/2 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-1000/2/index.html
@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?
Job PR-1000/4 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-1000/4/index.html
I will reconfirm the results on all sample.
@xiaotinghe any update?
@szha @eric-haibin-lin I have reconfirmed the results for all the data. I will update the results later.
Ping @xiaotinghe
@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