Skip to content

PN2V Algorithm Config

Source

PN2V Algorithm configuration.

PN2VAlgorithm

Bases: UNetBasedAlgorithm

PN2V Algorithm configuration.

algorithm = 'pn2v' class-attribute instance-attribute

PN2V Algorithm name.

loss = 'pn2v' class-attribute instance-attribute

PN2V loss function (uses N2V loss with noise model).

lr_scheduler = LrSchedulerConfig() class-attribute instance-attribute

Learning rate scheduler to use, defined in SupportedLrScheduler.

noise_model instance-attribute

Noise model configuration for probabilistic denoising.

optimizer = OptimizerConfig() class-attribute instance-attribute

Optimizer to use, defined in SupportedOptimizer.

__str__()

Pretty string representing the configuration.

Returns:

  • str

    Pretty string.

get_algorithm_citations()

Return a list of citation entries of the current algorithm.

This is used to generate the model description for the BioImage Model Zoo.

Returns:

  • List[CiteEntry]

    List of citation entries.

get_algorithm_description()

Return a description of the algorithm.

This method is used to generate the README of the BioImage Model Zoo export.

Returns:

  • str

    Description of the algorithm.

get_algorithm_friendly_name()

Get the friendly name of the algorithm.

Returns:

  • str

    Friendly name.

get_algorithm_keywords()

Get algorithm keywords.

Returns:

get_algorithm_references()

Get the algorithm references.

This is used to generate the README of the BioImage Model Zoo export.

Returns:

  • str

    Algorithm references.

get_num_input_channels()

Get the number of input channels.

Returns:

  • int

    Number of input channels.

is_struct_n2v()

Check if the configuration is using structPN2V.

Returns:

  • bool

    Whether the configuration is using structPN2V.

set_n2v2(use_n2v2)

Set the configuration to use PN2V2 or the vanilla Probabilistic Noise2Void.

This method ensures that PN2V2 is set correctly and remain coherent, as opposed to setting the different parameters individually.

Parameters:

  • use_n2v2 (bool) –

    Whether to use PN2V2.

uses_batch_norm()

Return whether the model uses batch normalization.

Returns:

  • bool

    Whether the model uses batch normalization.

validate_n2v2()

Validate that the N2V2 strategy and models are set correctly.

Returns:

  • Self

    The validated configuration.

Raises:

  • ValueError

    If N2V2 is used with the wrong pixel manipulation strategy.