Commit 65d79ea
Log avg_distance_per_infraction (port from emerge/temp_training)
Adds the metric:
avg_distance_per_infraction = total_distance_travelled / total_infractions
which tracks how far agents drive between offroad/collision/red-light
events — a useful single-scalar driving-quality signal for wandb.
The two underlying log fields already exist in puffer-4 and are already
aggregated per-step in add_log; only the binding-side ratio was missing.
Both fields are normalized per-agent by static_vec_aggregate_logs, but
the ratio is invariant to that 1/n scaling so we just compute it
directly. Tiny epsilon clamp on the denominator guards against
div-by-zero in the rare case of zero infractions across the entire
aggregation window.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 094a2af commit 65d79ea
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
186 | 194 | | |
187 | 195 | | |
188 | 196 | | |
| |||
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
| 202 | + | |
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
| |||
0 commit comments