Skip to content

accuracy_validator

AccuracyValidator

Bases: TorchmetricsValidator

Returns accuracy using the torchmetrics accuracy function.

The required dataset splits are ["src_val"]. This can be changed using key_map.

Source code in pytorch_adapt\validators\accuracy_validator.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
class AccuracyValidator(TorchmetricsValidator):
    """
    Returns accuracy using the
    [torchmetrics accuracy function](https://torchmetrics.readthedocs.io/en/latest/references/functional.html#accuracy-func).

    The required dataset splits are ```["src_val"]```.
    This can be changed using [```key_map```][pytorch_adapt.validators.BaseValidator.__init__].
    """

    @property
    def accuracy_fn(self):
        return accuracy