- class composer.metrics.LossMetric(loss_function, dist_sync_on_step=False)#
Turns a torch.nn Loss Module into distributed torchmetrics Metric.
loss_function (callable) – loss function to compute and track.
dist_sync_on_step (bool, optional) – sync distributed metrics every step. Default:
Aggregate state over all processes and compute the metric.
- update(preds, targets)#
Update the state with new predictions and targets.