Skip to content
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

Deprecate the Trainer #115

Open
avik-pal opened this issue Sep 2, 2019 · 5 comments
Open

Deprecate the Trainer #115

avik-pal opened this issue Sep 2, 2019 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@avik-pal
Copy link
Member

avik-pal commented Sep 2, 2019

Background

TorchGAN started out with a primary focus on GANs. But recent literature has suggested that GANs are being used in time series modeling, NLP, etc. Hence the name Trainer sends the wrong message.

Proposal

  1. Deprecate Trainer and ParallelTrainer in v0.0.4 and completely remove them in v0.0.5+
  2. Introduce an ImageTrainer and ParallelImageTrainer which are exact copies of the current version of Trainer and ParallelTrainer.
  3. Introduce application-specific Trainers to broaden the scope of TorchGAN. RGAN and RCGAN implementation #110 discusses this.
@avik-pal avik-pal added help wanted Extra attention is needed good first issue Good for newcomers v0.0.3 Upcoming Tag Version labels Sep 2, 2019
@dsevero
Copy link

dsevero commented Sep 3, 2019

I can start on this in about 2 weeks if nobody else gets on it :)

@avik-pal avik-pal removed the v0.0.3 Upcoming Tag Version label Sep 18, 2019
@dsevero
Copy link

dsevero commented Sep 21, 2019

What do you guys think of using pytorch-lightning to refactor the trainer?

@avik-pal
Copy link
Member Author

Yes, I looked at it a couple of days back. It provides a really good baseline to redesign our Trainer. It also helps remove all the boilerplate logging code and also benefit from new additions to the training techniques there.

Having said that, I am still not comfortable with completely dropping the vanilla pytorch based trainer. Maybe we can shift to a pytorch-lightning based Trainer and move the entire current Training + Logging code to a legacy module.

@dsevero
Copy link

dsevero commented Sep 21, 2019

I vote for fully dropping the current Trainer only on a new major release. How about the following:

Currently we have:

  • BaseTrainer()
  • Trainer(BaseTrainer)
  • ParallelTrainer(BaseTrainer)

We should move towards:

  • BaseTrainer() -> LegacyBaseTrainer()
  • Trainer(BaseTrainer) -> LegacyTrainer(LegacyBaseTrainer)
  • ParallelTrainer(BaseTrainer) -> LegacyParallelTrainer(LegacyBaseTrainer)

New stuff

  • PyLightningTrainer()
  • SequentialTrainer(PyLightningTrainer)
  • ImageTrainer(PyLightningTrainer)

Scaling training is handled by pytorch-lightning.

Do we move the logging module into legacy also?

@avik-pal
Copy link
Member Author

LGTM only I think instead of doing BaseTrainer() -> LegacyBaseTrainer() and the other 2, we should do trainer.BaseTrainer() -> legacy.trainer.BaseTrainer(). Its easier to modify the code IMO.

The logger can then be moved to legacy.logging module as we don't need the logger for pylightning as far as I have seen their code.

@avik-pal avik-pal removed the good first issue Good for newcomers label May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants