ggt.metrics

Submodules

Classes

ElementwiseMae

Calculates the element-wise mean absolute error.

Package Contents

class ggt.metrics.ElementwiseMae(output_transform: Callable = lambda x: ..., device: str | torch.device = torch.device('cpu'), skip_unrolling: bool = False)

Bases: ignite.metrics.Metric

Calculates the element-wise mean absolute error.

reset() None

Resets the metric to its initial state.

By default, this is called at the start of each epoch.

update(output: Sequence[torch.Tensor]) None

Updates the metric’s state using the passed batch output.

By default, this is called once for each batch.

Args:

output: the is the output from the engine’s process function.

compute() float | torch.Tensor

Computes the metric based on its accumulated state.

By default, this is called at the end of each epoch.

Returns:
Any: | the actual quantity of interest. However, if a Mapping is returned,

it will be (shallow) flattened into engine.state.metrics when completed() is called.

Raises:

NotComputableError: raised when the metric cannot be computed.