dgs.models.metric.get_metric¶
- dgs.models.metric.get_metric(instance: str | type) Type[torch.nn.Module] [source]¶
Given the name or an instance of a metric, return the respective instance.
- Parameters:
instance – Either the name of the metric, which has to be in :data:
METRICS
, or a subclass ofMetric
.- Raises:
ValueError – If the instance has the wrong type.
- Returns:
The class of the given metric.