available_losses

available_losses(task=Task.SEMANTIC_SEGMENTATION)

The losses you can name under loss, which is not the same list at every task.

Eleven at semantic_segmentation and fourteen at instance_segmentation, and the three in the difference are the regression family - mse, l1, smooth_l1. They score a continuous target, and the only continuous target this package has is a flow field, so at the semantic task there is nothing to name them on: a model’s own loss scores the classes, and SegmentationModel.the_mask_needs_a_loss_over_classes refuses them there by name (pyplatypus#223). At the instance task they are listed because a separation: flows block has its own loss for the vector channels - but not for the model’s own loss, which is the mask at either separation and refuses them too.

So this answers what may be named under some loss at this task. Which loss goes where is the tree, and available_separations() is where that lives rather than a fourth column here.

Returns

Name Type Description
list[dict[str, Any]] One row per loss: the name, the arguments it accepts, and what it is for.

Raises

Name Type Description
PlatypusError for object_detection, which chooses no loss component. Its objective is fixed and box_loss on the model picks the box term.

[row[“name”] for row in available_losses()][:3] [‘boundary’, ‘cce’, ‘cce_dice’] next(row for row in available_losses() if row[“name”] == “tversky”)[“arguments”] (‘alpha’, ‘smooth’) len(available_losses()), len(available_losses(“instance_segmentation”)) (11, 14) sorted(set(r[“name”] for r in available_losses(“instance_segmentation”)) … - set(r[“name”] for r in available_losses())) [‘l1’, ‘mse’, ‘smooth_l1’]