topobench.evaluator.metrics package#

Init file for custom metrics in evaluator module.

class ExampleRegressionMetric(squared=True, num_outputs=1, **kwargs)#

Bases: Metric

Example metric.

Parameters:
squaredbool

Whether to compute the squared error (default: True).

num_outputsint

The number of outputs.

**kwargsAny

Additional keyword arguments.

__init__(squared=True, num_outputs=1, **kwargs)#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

compute()#

Compute mean squared error over state.

Returns:
torch.Tensor

Mean squared error.

update(preds, target)#

Update state with predictions and targets.

Parameters:
predstorch.Tensor

Predictions from model.

targettorch.Tensor

Ground truth values.

full_state_update: bool | None = False#
higher_is_better: bool | None = False#
is_differentiable: bool | None = True#
sum_squared_error: Tensor#
total: Tensor#

Submodules#