Slash-namespace logged metric keys for W&B grouping
Adopt a 5-namespace scheme so wandb groups related metrics in the
sidebar and capture-group regex (eval/(random|safe_heuristic)/win_rate0
vs eval/(?:random|safe_heuristic)/win_rate0) controls panel splitting:
- loss/{advantage,strategy}
- samples/{advantage,strategy,advantage_player_N}
- memory/{advantage,strategy,advantage_player_N}
- time/{iteration_seconds,traversal_seconds,advantage_train_seconds,
strategy_train_seconds,evaluation_seconds,memory_add_seconds,
checkpoint_seconds,batch_tensor_seconds,nodes_per_second,
advantage_player_N_sample_seconds,strategy_sample_seconds}
- traversal/{nodes,terminals,depth_cutoffs,node_limit_cutoffs,
max_depth_reached,endpoints,avg_endpoint_depth,
endpoint_depth_bucket_*,regret_fallback_*,sampled_actions}
- eval/<opponent>/<metric> (3-level so opponent can be the capture group)
`iteration` keeps no namespace (it's the wandb step axis). Internal
TraversalStats.to_dict() and benchmark.py's standalone result dict
keep their flat names — only the trainer's emitted metrics are
remapped, with the traversal_*→traversal/* translation done at
insertion into runtime_metrics.
analyze.py updated to read the new keys (PlotSpec metrics, color map,
opponent_names parser, _first_existing_eval lookup). Tests updated for
the new eval_metrics dict keys.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -670,14 +670,14 @@ def test_deep_cfr_trainer_saves_loads_and_evaluates_checkpoint(tmp_path) -> None
|
||||
assert "[i=1]" in train_log
|
||||
assert "reservoir memories and RNG state are not restored" in train_log
|
||||
assert restored.iteration == 1
|
||||
assert "eval_random_games" in metrics[0].eval_metrics
|
||||
assert "eval_random_play_action_rate" in metrics[0].eval_metrics
|
||||
assert "eval_random_policy_entropy" in metrics[0].eval_metrics
|
||||
assert "eval_random_avg_opened_colors" in metrics[0].eval_metrics
|
||||
assert "eval_random_bad_open_actions" in metrics[0].eval_metrics
|
||||
assert "eval_random_positive_expedition_rate" in metrics[0].eval_metrics
|
||||
assert "eval/random/games" in metrics[0].eval_metrics
|
||||
assert "eval/random/play_action_rate" in metrics[0].eval_metrics
|
||||
assert "eval/random/policy_entropy" in metrics[0].eval_metrics
|
||||
assert "eval/random/avg_opened_colors" in metrics[0].eval_metrics
|
||||
assert "eval/random/bad_open_actions" in metrics[0].eval_metrics
|
||||
assert "eval/random/positive_expedition_rate" in metrics[0].eval_metrics
|
||||
assert (
|
||||
"eval_random_first_open_recoverable_score_mean_for_positive_final"
|
||||
"eval/random/first_open_recoverable_score_mean_for_positive_final"
|
||||
in metrics[0].eval_metrics
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user