MCPcopy Create free account
hub / github.com/DFin/Neural-Network-Visualisation / format_snapshot_description

Function format_snapshot_description

training/mlp_train.py:306–320  ·  view source on GitHub ↗
(
    milestone: TimelineMilestone,
    images_seen: int,
    batches_seen: int,
    dataset_size: int,
)

Source from the content-addressed store, hash-verified

304
305
306def format_snapshot_description(
307 milestone: TimelineMilestone,
308 images_seen: int,
309 batches_seen: int,
310 dataset_size: int,
311) -> str:
312 if milestone.kind == "initial":
313 return "0 images processed (random initialisation)"
314 dataset_passes = images_seen / dataset_size if dataset_size else 0.0
315 human_images = f"{images_seen:,}"
316 batches = f"{batches_seen:,}"
317 if milestone.kind == "dataset_multiple" and milestone.dataset_multiple is not None:
318 multiplier = f"{milestone.dataset_multiple:g}× dataset"
319 return f"{human_images} images • {multiplier} • {batches} batches"
320 return f"{human_images} images processed • {batches} batches • {dataset_passes:.2f}× dataset"
321
322
323def main() -> None:

Callers 1

record_snapshotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected