From 4c190727242d8301cb6ff704678d136613db858f Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Wed, 29 Jul 2026 10:49:12 +0200 Subject: [PATCH] Skip empty-slice mean/std in sec phys validation print The per-dim print loop lacked the empty-array guard already used for the KL computation right above it and the sec-slot loop further down, so an all-zero-secondaries validation batch (e.g. early/unstable training) triggered numpy RuntimeWarnings from .mean()/.std() on empty arrays. Co-Authored-By: Claude Sonnet 5 --- giant/validate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/giant/validate.py b/giant/validate.py index 44ae071..62a88df 100644 --- a/giant/validate.py +++ b/giant/validate.py @@ -215,6 +215,8 @@ def validate_marginals( print("-" * 68) for j, name in enumerate(_SEC_PHYS_NAMES): r, g = phys_real[:, j], phys_gen[:, j] + if len(r) == 0 or len(g) == 0: + continue print( f"{name:<20} {r.mean():>10.4f} {g.mean():>10.4f} " f"{r.std():>10.4f} {g.std():>10.4f} {phys_kl[j]:>14.4f}"