Bug in epoch calculation

Open
#82 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Read codegen_sources/model/src/trainer.py at line 1483 and codegen_sources/model/train.py at line 742 to understand how sentence counts trigger epoch boundaries. Check the training loop's batch and tensor sizes, then verify that the epoch check uses the intended count and behaves correctly on batches that do not match params.batch_size.

Written by the indexing model from the issue text.

Description

At line no. 1483 in the file codegen_sources/model/src/trainer.py. the code is
self.n_sentences += params.batch_size I think it should be self.n_sentences += len1.size(0)
https://github.com/facebookresearch/CodeGen/blob/6e93aca63e7bc77287c9965a5080456326651237/codegen_sources/model/src/trainer.py#L1483

With above bug notion of one epoch becomes wrong because of check at following line.

https://github.com/facebookresearch/CodeGen/blob/6e93aca63e7bc77287c9965a5080456326651237/codegen_sources/model/train.py#L742

Dominant language
Python
Stars
777
Forks
144
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebookresearch/CodeGen

All issues in facebookresearch/CodeGen

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.