Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Refactored training function. (#481) #693

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ed728
Copy link
Contributor

@ed728 ed728 commented Dec 19, 2019

What this patch does to fix the issue.

Splits the start_training function into functions in a class. More readability changes will be added later. This commit just moves functionality around. The functions was very large, so a smaller commit than this was not possible. This commit only moves stuff around for ease of reviewing.

Link to any relevant issues or pull requests.

Based on #481 .

More PRs will be added after this.

Testing.

Manual and CI.

@ed728 ed728 force-pushed the train branch 3 times, most recently from 89bea83 to 9a0e30f Compare January 14, 2020 11:56
@ed728 ed728 added the CI: auto-run Run CI automatically label Jan 16, 2020
@ed728 ed728 force-pushed the train branch 8 times, most recently from 04ed363 to 137af74 Compare January 23, 2020 03:13
@ed728 ed728 force-pushed the train branch 6 times, most recently from 62c76ca to 0c01215 Compare January 31, 2020 01:47
@ed728 ed728 added the CI: test-all Run all tests once label Feb 27, 2020
@blueoil-butler blueoil-butler bot removed the CI: test-all Run all tests once label Feb 27, 2020
@ed728 ed728 changed the title [WIP]Refactored training function. (#481) Refactored training function. (#481) Feb 28, 2020
@bo-code-review-bot
Copy link

This PR needs Approvals as follows.

  • Ownership Approval for / from iizukak, tkng, ruimashita
  • Readability Approval for Python from tkng, tsawada

Please choose reviewers and requet reviews!

Click to see how to approve each reviews

You can approve this PR by triggered comments as follows.

  • Approve all reviews requested to you (readability and ownership) and LGTM review
    Approval, LGTM

  • Approve all ownership reviews
    Ownership Approval or OA

  • Approve all readability reviews
    Readability Approval or RA

  • Approve specified review targets

    • Example of Ownership Reviewer of /: Ownership Approval for / or OA for /
    • Example of Readability Reviewer of Python: Readability Approval for Python or RA for Python
  • Approve LGTM review
    LGTM

See all trigger comments

Please replace [Target] to review target

  • Ownership Approval
    • Ownership Approval for [Target]
    • OA for [Target]
    • Ownership Approval
    • OA
    • Approval
  • Readability Approval
    • Readability Approval for [Target]
    • RA for [Target]
    • [Target] Readability Approval
    • [Target] RA
    • Readability Approval
    • RA
    • Approval
  • LGTM
    • LGTM
    • lgtm

@ed728 ed728 added the CI: test-all Run all tests once label Feb 28, 2020
@blueoil-butler blueoil-butler bot removed the CI: test-all Run all tests once label Feb 28, 2020
@ed728 ed728 requested a review from iizukak February 28, 2020 01:31
@ed728 ed728 added the CI: test-all Run all tests once label Feb 28, 2020
@blueoil-butler blueoil-butler bot removed the CI: test-all Run all tests once label Feb 28, 2020
@ed728 ed728 added the CI: test-all Run all tests once label Feb 28, 2020
@blueoil-butler blueoil-butler bot removed the CI: test-all Run all tests once label Feb 28, 2020
@ed728 ed728 added the CI: test-all Run all tests once label Feb 28, 2020
@blueoil-butler blueoil-butler bot removed the CI: test-all Run all tests once label Feb 28, 2020
@iizukak iizukak added the CI: test-all Run all tests once label Mar 1, 2020
@blueoil-butler blueoil-butler bot removed the CI: test-all Run all tests once label Mar 1, 2020
Copy link
Member

@iizukak iizukak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ed728
Thank you for this PR!!
Diff length is not problem in this PR.

In this PR, you created Trainer class and just move function code into the class.
I think after this PR, we will refactor start_training huge function.
This is not obvious refactoring.

Do you have any plan to solve #481 ?
I think it's good to make agreement with Blueoil developers.

@iizukak iizukak mentioned this pull request Mar 1, 2020
Copy link
Contributor

@tkng tkng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than small comments, LGTM.


self.validation_dataset = setup_dataset(self.config, "validation", self.rank, self.local_rank)
print("validation dataset num:", self.validation_dataset.num_per_epoch)
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this return statement, as it doesn't change behavior.

Comment on lines +189 to +190

return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove these two lines also?

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI: auto-run Run CI automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants