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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple loggers #903

Merged
merged 14 commits into from
Feb 25, 2020

Conversation

ethanwharris
Copy link
Member

@ethanwharris ethanwharris commented Feb 20, 2020

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos, doc improvements)
  • Did you read the contributor guideline?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

Fixes #317

  • Added a LoggerList class and tests
  • Choice of name / version for a list is a bit of a problem, currently it will join the versions / names on underscore so all of the information is there. @PyTorchLightning/core-contributors any other ideas?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 馃檭

@pep8speaks
Copy link

pep8speaks commented Feb 20, 2020

Hello @ethanwharris! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 馃嵒

Comment last updated at 2020-02-25 18:55:02 UTC

@Borda Borda added the feature Is an improvement or enhancement label Feb 20, 2020
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

Nice work! it is just my personal taste, I would simplify the class names...

pytorch_lightning/loggers/__init__.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/base.py Outdated Show resolved Hide resolved

@property
def experiment(self):
return [logger.experiment() for logger in self._logger_list]
Copy link
Member

Choose a reason for hiding this comment

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

this may be tricky since it returns list instead object...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is really just a precaution anyway as we don't use the experiment property internally. However, the experiment property is a different object for every logger so I think this is acceptable

Copy link
Member

Choose a reason for hiding this comment

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

I know, but we do not know about all user usage of these loggers lol

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure there's any other option here, any suggestions?

pytorch_lightning/loggers/base.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/logging.py Outdated Show resolved Hide resolved
@Borda
Copy link
Member

Borda commented Feb 21, 2020

we shall resolve the MNIST issue very soon #859

@ethanwharris ethanwharris marked this pull request as ready for review February 24, 2020 13:45
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

Great job with adding types! 馃殌
pls have look at my suggestion with an abstract method

pytorch_lightning/loggers/base.py Show resolved Hide resolved
pytorch_lightning/loggers/base.py Show resolved Hide resolved
pytorch_lightning/loggers/comet.py Outdated Show resolved Hide resolved
@williamFalcon williamFalcon added this to the 0.6.1 milestone Feb 25, 2020
@Borda Borda modified the milestones: 0.6.1, 0.6.2 Feb 25, 2020
@williamFalcon williamFalcon modified the milestones: 0.6.2, 0.6.1 Feb 25, 2020
@ethanwharris
Copy link
Member Author

Ok, have fixed those issues - this should be ready to go :)

@Borda
Copy link
Member

Borda commented Feb 25, 2020

Perfect, but rather I would wait till master is fixed, @williamFalcon #938

@williamFalcon
Copy link
Contributor

@ethanwharris @Borda tests are fixed. let's rebase!

@Borda
Copy link
Member

Borda commented Feb 25, 2020

@williamFalcon done but does not show any change, strange...

@ethanwharris
Copy link
Member Author

@Borda That should have fixed it, hopefully the tests will run now :)

@ethanwharris ethanwharris added the ready PRs ready to be merged label Feb 25, 2020
@williamFalcon
Copy link
Contributor

@ethanwharris
Copy link
Member Author

@williamFalcon Done :)

@williamFalcon williamFalcon merged commit a5f159b into Lightning-AI:master Feb 25, 2020
@williamFalcon
Copy link
Contributor

@ethanwharris amazing!

@ethanwharris ethanwharris deleted the feature/loggerlist branch February 25, 2020 20:06
@awaelchli
Copy link
Member

awaelchli commented Feb 25, 2020

@ethanwharris Very nice addition!! You even annotated the types :)

@williamFalcon
Copy link
Contributor

@ethanwharris is making our code look sloppy by comparison haha.

tullie pushed a commit to tullie/pytorch-lightning that referenced this pull request Apr 3, 2020
* Add support for multiple loggers

* Fix PEP

* Cleanup

* Cleanup

* Add typing to loggers

* Update base.py

* Replace duck typing with isinstance check

* Update CHANGELOG.md

* Update comet experiment type, Switch to abstractmethod in logging.py

* Fix test

* Add passes to LightningLoggerBase

* Update experiment_logging.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using multiple loggers
5 participants