LittlePlyResearch notebook

curriculum_loss.py

python · 5 lines · Exact bytes

Line 1 ↗
Version & provenance · cm8-training-v1

Recorded SHA-256 fdc4e8709e5d945fa620ee1ce5b4fa66a18d62192e8b2ad656d7674d5c8b3f61Rendered SHA-256 fdc4e8709e5d945fa620ee1ce5b4fa66a18d62192e8b2ad656d7674d5c8b3f61

Original LittlePly code: Apache-2.0. External Rust helper remains a separate GPL component. License notes. Line links are stable within this snapshot. Frozen research implementation; host paths redacted. Original and rendered digests identify the derivative; not a portable launcher or complete training payload.

1"""DDP averages gradients; normalize by the whole accumulated global target count."""
2def weighted_loss(loss,world,global_targets,empty=False):
3    if global_targets<=0:raise ValueError('empty global update')
4    return loss.sum()*(0. if empty else world/global_targets)
5