nnpd.nre.training¶
Readable BCE training, including exact global-batch sharding for DDP.
Functions¶
|
|
|
|
|
No sample padding or dropping: every training row contributes once per epoch. |
Module Contents¶
- nnpd.nre.training.predict_logits(model, x, theta, batch_size: int, device) numpy.ndarray¶
- nnpd.nre.training.classification(labels: numpy.ndarray, logits: numpy.ndarray) dict¶
- nnpd.nre.training.fit_binary(context, model) dict¶
No sample padding or dropping: every training row contributes once per epoch.
A batch is split by rank. Local loss SUM * world/global_count compensates for DDP’s gradient averaging even for unequal or empty last shards. An empty shard runs a zero-weight dummy forward to participate in collectives. The configured batch size is GLOBAL, not per GPU.