Skip to content

Model Validators

Source

Architecture model validators.

model_matching_in_out_channels(model)

Validate that the UNet model has the same number of channel inputs and outputs.

Parameters:

Returns:

Raises:

  • ValueError

    If the model has different number of input and output channels.

model_no_c_ind_for_mismatching_channels(model)

Validate that UNet models with mismatching input/output has dependent channels.

Parameters:

  • model (UNetModel) –

    Model to validate.

Returns:

  • UNetModel

    Validated model.

Raises:

  • ValueError

    If the model has independent_channels set to True while the number of input and output channels do not match.

model_without_final_activation(model)

Validate that the UNet model does not have the final_activation.

Parameters:

Returns:

Raises:

  • ValueError

    If the model has the final_activation attribute set.

model_without_n2v2(model)

Validate that the Unet model does not have the n2v2 attribute.

Parameters:

Returns:

Raises:

  • ValueError

    If the model has the n2v2 attribute set to True.