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

Enhanced rliable eval #1183

Merged
merged 16 commits into from
Aug 6, 2024
Merged

Enhanced rliable eval #1183

merged 16 commits into from
Aug 6, 2024

Conversation

MischaPanch
Copy link
Collaborator

@MischaPanch MischaPanch commented Aug 1, 2024

Rliable eval: multiple extensions

  1. Support for evaluating training runs (previously just test runs were supported)
  2. Improved handling of figures and axes
  3. Allow passing max_env_step
  4. Use min len of all experiments (bugfix, previously it would crash if experiments had different lengths)
  5. Extended the data loading logic such that it can handle data from low-level API experiments

Also some fixes and extensions in loggers

Michael Panchenko added 4 commits August 1, 2024 18:06
1. Support for evaluating training runs
2. Improved handling of figures and axes
3. Allow passing max_env_step
4. Use min len of all experiments (bugfix, previously it would crash if experiments had different lengths)
@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 19.44444% with 116 lines in your changes missing coverage. Please review.

Project coverage is 84.75%. Comparing base (3c523c8) to head (d622bef).

Files Patch % Lines
tianshou/evaluation/rliable_evaluation_hl.py 0.00% 88 Missing ⚠️
tianshou/highlevel/logger.py 34.78% 15 Missing ⚠️
tianshou/utils/logger/wandb.py 45.45% 6 Missing ⚠️
tianshou/evaluation/launcher.py 0.00% 4 Missing ⚠️
tianshou/data/stats.py 50.00% 1 Missing ⚠️
tianshou/utils/logger/base.py 92.30% 1 Missing ⚠️
tianshou/utils/logger/tensorboard.py 66.66% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1183      +/-   ##
==========================================
- Coverage   85.51%   84.75%   -0.77%     
==========================================
  Files         104      104              
  Lines        8874     8976     +102     
==========================================
+ Hits         7589     7608      +19     
- Misses       1285     1368      +83     
Flag Coverage Δ
unittests 84.75% <19.44%> (-0.77%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@maxhuettenrauch maxhuettenrauch left a comment

Choose a reason for hiding this comment

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

Changes lgtm, I've just added some comments in case we wanted to expand. Otherwise I'll approve

tianshou/highlevel/logger.py Outdated Show resolved Hide resolved
@@ -11,6 +12,8 @@
with contextlib.suppress(ImportError):
import wandb

log = logging.getLogger(__name__)


class WandbLogger(BaseLogger):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will need extra arguments for run grouping

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See above


test_data_found = True
train_data_found = True
if not test_episode_returns or env_step_at_test is None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably need another mechanism here as well. In the unfortunate event of all but the last run having recorded data, env_step_at_test may be None and the RuntimeError below is raised.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I feel like we should rather improve the logging and stats-saving mechanism to ensure this never happens instead of doing more gymnastics here. Would that be possible? We can do that in a separate issue/PR.

tianshou/evaluation/rliable_evaluation_hl.py Show resolved Hide resolved
@MischaPanch MischaPanch force-pushed the feature/enhanced-rliable-eval branch from 11b83ab to 21a7a3c Compare August 6, 2024 14:29
@MischaPanch
Copy link
Collaborator Author

@maxhuettenrauch Thanks for the logger extension and review! Merging this now

@MischaPanch MischaPanch merged commit 0c84ef6 into master Aug 6, 2024
@MischaPanch MischaPanch deleted the feature/enhanced-rliable-eval branch August 6, 2024 14:31
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.

3 participants