| 304 | |
| 305 | |
| 306 | def 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 | |
| 323 | def main() -> None: |