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

Log env_steps in wandb #307

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sample_factory/algo/learning/learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ def _record_summaries(self, train_loop_vars) -> AttrDict:
self.last_summary_time = time.time()
stats = AttrDict()

stats.env_steps = self.env_steps
stats.lr = self.curr_lr
stats.actual_lr = train_loop_vars.actual_lr # potentially scaled because of masked data

Expand Down
8 changes: 8 additions & 0 deletions sample_factory/utils/wandb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ def init_wandb_func():

wandb.config.update(cfg, allow_val_change=True)

wandb.define_metric("train/env_steps")
Copy link
Owner

Choose a reason for hiding this comment

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

This can probably be a loop over a list of patterns to make the code a bit cleaner

wandb.define_metric("train/*", step_metric="train/env_steps")
wandb.define_metric("perf/*", step_metric="train/env_steps")
wandb.define_metric("len/*", step_metric="train/env_steps")
wandb.define_metric("policy_stats/*", step_metric="train/env_steps")
wandb.define_metric("reward/*", step_metric="train/env_steps")
wandb.define_metric("stats/*", step_metric="train/env_steps")


def finish_wandb(cfg):
if cfg.with_wandb:
Expand Down
Loading