class RoutedAccumMetric[source]

RoutedAccumMetric(metric, pred_idx, target_idx) :: AccumMetric

AccumMetric with predictions and targets for a specific model head.

route_to_metric[source]

route_to_metric(metric, pred_idx, target_idx)

Routes model output at pred_idx and target at index target_idx to metric

mtl_metrics[source]

mtl_metrics(*metrics_list)

Convenience function to route each prediction to list of metrics by their order.

Example usage for routing the first model prediction to F1Score and accuracy, while routing the second one to R2Score.

learn = Learner(...
    metrics = mtl_metrics([F1Score(average='macro'), accuracy], [R2Score])
)