-
Notifications
You must be signed in to change notification settings - Fork 131
Proof of concept for command-line training #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Super cool, thanks @jscanvic ! |
Andrewwango
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments, this is super cool, thanks Jérémy!
| @@ -0,0 +1,23 @@ | ||
| dataset: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should provide somewhere in the repo example/template configs? or perhaps even in examples, each example involving training can be used in either notebook mode or using the provided config that we provide?
| import argparse | ||
|
|
||
|
|
||
| class CommandLineTrainer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future extensibility, can we generalise this to just a CLIParser or something, that handles all the config ingestion, and then maybe have CommandLineTrainer as a subclass or something with only the core Trainer orchestration?
| num_workers=2, | ||
| ) | ||
| trainer = dinv.training.Trainer( | ||
| epochs=10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of doing a one-to-one mapping between config params and trainer options, such that this can be reduced to just like **parsed_kwargs?
| import argparse | ||
|
|
||
|
|
||
| class CommandLineTrainer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pytest this?
| args: argparse.Namespace = parser.parse_args() | ||
|
|
||
| if args.command == "train": | ||
| trainer = CommandLineTrainer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could have a cli submodule which contains all the orchestrators e.g. CommandLineTrainer, CommandLineOptim etc. to keep this __main__ clean. And also keep this argparser clean, and the individual files in cli can contain the task-specific args
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #821 +/- ##
==========================================
- Coverage 83.79% 83.21% -0.58%
==========================================
Files 204 205 +1
Lines 20503 20643 +140
Branches 2807 2840 +33
==========================================
- Hits 17180 17179 -1
- Misses 2410 2550 +140
- Partials 913 914 +1 ☔ View full report in Codecov by Sentry. |
A proof of concept towards #496
Usage
Denoising
Super-resolution
Example