dacapo.experiments.tasks.losses.affinities_loss

Module Contents

Classes

AffinitiesLoss

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

class dacapo.experiments.tasks.losses.affinities_loss.AffinitiesLoss(num_affinities: int, lsds_to_affs_weight_ratio: float)

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

compute(prediction, target, weight)

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.