Skip to content

N2V Module

Source

Noise2Void Lightning Module.

N2VModule

Bases: LightningModule

CAREamics PyTorch Lightning module for N2V algorithm.

Parameters:

  • algorithm_config (N2VAlgorithm or dict) –

    Configuration for the N2V algorithm, either as an N2VAlgorithm instance or a dictionary.

__init__(algorithm_config)

Instantiate N2VModule.

Parameters:

  • algorithm_config (N2VAlgorithm or dict) –

    Configuration for the N2V algorithm, either as an N2VAlgorithm instance or a dictionary.

configure_optimizers()

Configure optimizer and learning rate scheduler.

Returns:

  • dict[str, Any]

    A dictionary containing the optimizer and learning rate scheduler.

forward(x)

Forward pass.

Parameters:

  • x (Tensor) –

    Input tensor.

Returns:

  • Tensor

    Model output tensor.

on_fit_start()

On fit start hook for N2V module.

predict_step(batch, batch_idx)

Prediction step for N2V model.

Parameters:

Returns:

training_step(batch, batch_idx)

Training step for N2V model.

Parameters:

Returns:

  • Tensor

    The loss value for the current training step.

validation_step(batch, batch_idx)

Validation step for N2V model.

Parameters: