Enable customizable logging backends and logger subclassing#208
Open
MarkusPorti wants to merge 2 commits into
Open
Enable customizable logging backends and logger subclassing#208MarkusPorti wants to merge 2 commits into
MarkusPorti wants to merge 2 commits into
Conversation
- Inject own Logging implementation - Inject own LogWriter implementation
Collaborator
|
Hi @MarkusPorti, thanks a lot for the PR! After reviewing it, I decided to go for a slightly different implementation in #211. I would really appreciate a quick review if you find the time :) Cheers, Clemens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements changes proposed / discussed in #207
Summary
LogWriter, an ABC that defines the interface for logging backends.Loggernow accepts an optionalwriter: LogWriterconstructor argument for injecting a custom backend (e.g. MLflow, a database) without touching the config.OnPolicyRunner.__init__addsLoggeras possible type forlog_dirparameter. Pass a path string for default behavior, or a pre-builtLogger(or subclass) instance for full customization.OnPolicyRunner.__init__gets a new parameterwriter. Pass a customLogWriterto choose where the default logs are stored.WandbSummaryWriterandNeptuneSummaryWriternow explicitly inherit fromLogWriter, replacing ad-hoclogger_typestring guards withisinstancechecks throughoutLogger.LogWriterandLoggerare exported fromrsl_rl.utils.Extension patterns
Custom backend (where data goes) — subclass
LogWriter:Custom metrics (what gets logged) — subclass Logger:
Backward compatibility
All existing usage (cfg["logger"] = "tensorboard"/"wandb"/"neptune", passing log_dir as a string) is unchanged.