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

(v3.5.4) - WandBLogger: Possibility to not register incomplete episodes #438

Merged
merged 11 commits into from
Sep 5, 2024

Conversation

AlejandroCN7
Copy link
Member

Description

This PR adds a new argument to the WandBLogger wrapper. This allows you to specify the minimum percentage of an episode that must be complete for the metrics summarizing the episode to be recorded under the episode_summaries tab.

By default, it records episodes that are 90% complete or more, but this threshold can be adjusted when instantiating the wrapper if desired. This prevents the recording of accidental empty episodes (see the related issue).

This update also includes minor fixes related to the calculation of the number of steps per episode and SB3 native logger writter. For more information, please check the changelog.

Motivation and Context

  • I have raised an issue to propose this change (required for new features and bug fixes)

Fixes #431

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Improvement (of an existing feature)
  • Others

Checklist:

  • I've read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests.
  • I have updated the documentation accordingly.
  • I have reformatted the code using autopep8 second level aggressive.
  • I have reformatted the code using isort.
  • I have ensured cd docs && make spelling && make html pass (required if documentation has been updated.)
  • I have ensured pytest tests/ -vv pass. (required).
  • I have ensured pytype -d import-error sinergym/ pass. (required)

Changelog:

  • Timesteps: reset call is not considered a timestep. Fixinf LoggerWrappers with this.
  • BaseLoggerWrapper: Delete commented code about reset log.
  • Callbacks: Eval freq with -1 to avoid SB3 automatic reset() before evaluation.
  • NativeSb3 logger: wandb.log call with its own metric.
  • Documentation: Added episode percentage constraint to the WandB documentation.

@AlejandroCN7 AlejandroCN7 merged commit f6cb80a into main Sep 5, 2024
4 checks passed
@AlejandroCN7 AlejandroCN7 deleted the bug/issue-431 branch September 5, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: WandB last episode log in SB3 algorithms
1 participant