Skip to main content
W&B におけるメトリクス名は、UI 上で適切に並べ替え(ソート)やフィルタリングを行えるように、GraphQL の命名規則に従う必要があります。

有効なメトリクス名

  • Allowed characters: Letters (A-Z, a-z), digits (0-9), and underscores (_)
  • Starting character: Names must start with a letter or underscore
  • Pattern: Metric names should match /^[_a-zA-Z][_a-zA-Z0-9]*$/
これらのルールに従っていないメトリクスは、W&B UI でソートやフィルタリングができない場合があります。

Valid metric names:
with wandb.init() as run:
  run.log({"accuracy": 0.9, "val_loss": 0.1, "epoch_5": 5})
  run.log({"modelAccuracy": 0.95, "learning_rate": 0.001})
Invalid metric names (avoid these):
with wandb.init() as run:
  run.log({"acc,val": 0.9})  # Contains comma
  run.log({"loss-train": 0.1})  # Contains hyphen
  run.log({"test acc": 0.95})  # Contains space
  run.log({"5_fold_cv": 0.8})  # Starts with number

推奨される解決策

無効な文字をアンダースコアなどの有効な文字に置き換えてください。
  • "test acc" の代わりに "test_acc" を使用する
  • "loss-train" の代わりに "loss_train" を使用する
  • "acc,val" の代わりに "acc_val" を使用する
詳細については、Metric naming constraints(英語)を参照してください。