dacapo.experiments.tasks.losses.loss

Module Contents

Classes

Loss

Helper class that provides a standard way to create an ABC using

class dacapo.experiments.tasks.losses.loss.Loss

Helper class that provides a standard way to create an ABC using inheritance.

abstract compute(prediction: torch.Tensor, target: torch.Tensor, weight: torch.Tensor | None = None) torch.Tensor

Compute the loss for the given prediction and target. Optionally, if given, a loss weight should be considered.

All arguments are torch tensors. The return type should be a torch scalar that can be used with an optimizer, just as usual when training with torch.