-
Notifications
You must be signed in to change notification settings - Fork 607
Enable passing custom logging services #211
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
Open
ClemensSchwarke
wants to merge
8
commits into
leggedrobotics:main
Choose a base branch
from
ClemensSchwarke:feature/enable_custom_loggers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
80fd11c
implement option to pass custom loggers
ClemensSchwarke ed254de
rename files to be consistent with class names
ClemensSchwarke 4d0cd66
update docs
ClemensSchwarke b7566f8
Add Markus to contributors
ClemensSchwarke 1921a3e
fix wandb logging bug
ClemensSchwarke 345bea6
fix docstring
ClemensSchwarke 1da6355
Update version
ClemensSchwarke fcde9a4
Add tensorboard as a dependency
ClemensSchwarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Copyright (c) 2021-2026, ETH Zurich and NVIDIA CORPORATION | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import pathlib | ||
| from abc import ABC, abstractmethod | ||
|
|
||
|
|
||
| class LogWriter(ABC): | ||
| """Abstract base class for logging backends. | ||
|
|
||
| Log writers are configured via ``cfg["logger"]``, a dict with a ``"class_name"`` key pointing to the subclass and | ||
| any additional keys forwarded as constructor kwargs. The class is resolved via | ||
| :func:`~rsl_rl.utils.resolve_callable`. Only :meth:`add_scalar` must be implemented; all other methods are no-ops. | ||
| """ | ||
|
|
||
| @abstractmethod | ||
| def add_scalar(self, tag: str, scalar_value: float, global_step: int) -> None: | ||
| """Log a scalar metric. | ||
|
|
||
| Args: | ||
| tag: Name of the metric. | ||
| scalar_value: Value of the metric. | ||
| global_step: Current training iteration. | ||
| """ | ||
|
|
||
| def store_config(self, env_cfg: dict | object, train_cfg: dict) -> None: | ||
| """Upload environment and training configuration. Called once at training start.""" | ||
|
|
||
| def save_model(self, model_path: str, it: int) -> None: | ||
| """Upload a model checkpoint.""" | ||
|
|
||
| def save_file(self, path: str) -> None: | ||
| """Upload an arbitrary file.""" | ||
|
|
||
| def save_video(self, video: pathlib.Path, it: int) -> None: | ||
| """Upload a video file.""" | ||
|
|
||
| def stop(self) -> None: | ||
| """Finalize and close the logging run.""" |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.