torch_metrics_packages
- class aitoolbox.experiment.result_package.torch_metrics_packages.TorchMetricsPackage(torch_metrics)[source]
Bases:
AbstractResultPackage
Torch Metrics result package wrapper
https://github.com/Lightning-AI/metrics
- Parameters:
torch_metrics (torchmetrics.Metric or torchmetrics.MetricCollection) – single torchmetrics metric object or a collection of such metrics wrapped inside the MetricCollection
- prepare_results_dict()[source]
Perform result package building
Mostly this consists of executing calculation of selected performance metrics and returning their result dicts. If you want to use multiple performance metrics you have to combine them in the single self.results_dict at the end by doing this:
return {**metric_dict_1, **metric_dict_2}
- Returns:
calculated result dict
- Return type: