Evaluation

Metric functions used to populate a harness’s eval_metrics map. Their order in that map is what drift_detection.metric_index indexes into.

apeiron.evaluation.metrics.accuracy_topk(output, target, topk=(1,))

Computes the accuracy over the k top predictions for the specified values of k

apeiron.evaluation.metrics.accuracy(output, target)
apeiron.evaluation.evaluation.test(model, loader, criterion, cfg)[source]

Evaluate the model on the given dataset.

Parameters: model (torch.nn.Module): The model to evaluate. loader (torch.utils.data.DataLoader): The dataset loader. Graph (int): Whether the data is a graph (0) or image (1). Defaults to 0.

# KR: I am removing graph support for now, because, we want this to be # transferred to the model team eventually.

Returns: float: The ratio of correct predictions.