medkit.training.utils
medkit.training.utils#
Classes:
A BatchData pack data allowing both column and row access |
|
|
A MetricsComputer is the base protocol to compute metrics in training |
- class BatchData[source]#
A BatchData pack data allowing both column and row access
Methods:
to_device
(device)Ensure that Tensors in the BatchData object are on the specified device
- class MetricsComputer(*args, **kwargs)[source]#
A MetricsComputer is the base protocol to compute metrics in training
Methods:
compute
(all_data)Compute metrics using 'all_data'
prepare_batch
(model_output, input_batch)Prepare a batch of data to compute the metrics
- compute(all_data)[source]#
Compute metrics using ‘all_data’
- Parameters
all_data (Dict[str, List[Any]]) – A dictionary to compute the metrics. i.e. A dictionary with a list of ‘references’ and a list of ‘predictions’.
- Return type
Dict
[str
,float
]- Returns
Dict[str, float] – A dictionary with the results