SegmentationSpec

SegmentationSpec()

Methods

Name Description
channels_follow_the_data Fill channels from channels_from before the models are built.
channels_match_the_data One pattern per channel - **derived when the model stayed silent, checked when it
nothing_watches_a_validation_number_that_will_not_arrive A callback cannot wait for val_loss in a run that has no validation set.
overlapping_classes_rule_out_two_settings What an independent-channel naming cannot be combined with, said here rather

channels_follow_the_data

SegmentationSpec.channels_follow_the_data(config)

Fill channels from channels_from before the models are built.

Before rather than after, because a built model is frozen - and frozen is right: a specification that rewrote itself during validation would be a different thing from the one somebody wrote. This fills a blank in the configuration instead, which is what a reader would have had to do by hand.

channels_match_the_data

SegmentationSpec.channels_match_the_data()

One pattern per channel - derived when the model stayed silent, checked when it did not.

channels_from names one file per channel, so it already says how many there are; a model restating it could only ever disagree, and the disagreement surfaced deep inside torch as a shape mismatch rather than here. Unlike n_class the field does not simply go: without channels_from it is a real choice, because the same files can be read as one channel or three.

So: silent means derived, stated means checked. model_fields_set is what tells those apart - a channels=3 the caller wrote and the default that was there anyway are the same value and not the same claim.

nothing_watches_a_validation_number_that_will_not_arrive

SegmentationSpec.nothing_watches_a_validation_number_that_will_not_arrive()

A callback cannot wait for val_loss in a run that has no validation set.

overlapping_classes_rule_out_two_settings

SegmentationSpec.overlapping_classes_rule_out_two_settings()

What an independent-channel naming cannot be combined with, said here rather than at training time.

Both of them: regions and classes_from differ only in the file on disk, so the refusals read data.multilabel and name whichever field was written. The prose below says regions because that is the naming it was found on.

Two things, and they fail differently.

lovasz is not a tuning away from working. The Lovasz-Softmax surrogate sorts the errors of a softmax over mutually exclusive classes and walks the Lovasz extension of the Jaccard loss along that order; the independent form is the Lovasz-Hinge, a different construction. Run as it stands on sigmoid channels it would produce a number and a gradient, which is the worst available outcome.

include_background: false has nothing to exclude: regions has no background entry, so channel 0 is the first region somebody asked for and dropping it would drop a class. Refused only when it was written - cldice defaults it to False, and a default is not a request. model_fields_set is what tells those apart, the same way channels_match_the_data tells a stated channels from the one that was there anyway.