[RFC] Deprecate LightningLoggerBase.experiment
requirement from Logger interface
#11234
Labels
deprecation
Includes a deprecation
design
Includes a design discussion
logger
Related to the Loggers
refactor
Proposed refactor
Deprecate the
experiment
property required by the Logger interfacehttps://github.com/PyTorchLightning/pytorch-lightning/blob/dedfde6859a15270385e6e751567b29ab6488e87/pytorch_lightning/loggers/base.py#L104-L107
Motivation
experiment
carries no meaning as specified on the base logger. This is an object which can be anything.Currently, Lightning appears to promise users that
logger.experiment
will have a consistent interface across different logger implementations, which is not true!If users are interacting with the
experiment
directly, then they must already know what Logger implementation they're using.A good rule of thumb is that the only required interfaces for the Logger are what the Trainer directly calls. Everything else can be pushed to various implementations. Since the trainer does not interact with the
experiment
at all, it does not need to be required on the Logger API.What makes more sense is for the various logger implementations to directly offer public property on their interface. For example, the TensorBoard logger could expose the
SummaryWriter
as a property in its public interface for Tensorboard logger users to call in their own code.Pitch
experiment
definitions in the logger implementations top-level properties in their respective classes.experiment
off the base logger APIAdditional context
Originally posted by @ananthsub in #11209 (comment)
Part of #7740
cc @justusschock @awaelchli @akihironitta @tchaton @Borda @edward-io @ananthsub
The text was updated successfully, but these errors were encountered: