mridc.collections.common.losses package

Submodules

mridc.collections.common.losses.aggregator module

class mridc.collections.common.losses.aggregator.AggregatorLoss(num_inputs: int = 2, weights: Optional[List[float]] = None)[source]

Bases: Loss

Sums several losses into one.

Parameters
  • num_inputs (number of input losses) –

  • weights (a list of coefficient for merging losses) –

forward(**kwargs)[source]

Computes the sum of the losses.

property input_types

Returns definitions of module input ports.

property output_types

Returns definitions of module output ports.

reduction: str

mridc.collections.common.losses.ssim module

class mridc.collections.common.losses.ssim.SSIMLoss(win_size: int = 7, k1: float = 0.01, k2: float = 0.03)[source]

Bases: Module

SSIM loss module.

forward(X: Tensor, Y: Tensor, data_range: Tensor)[source]
Parameters
  • X (First input tensor.) –

  • Y (Second input tensor.) –

  • data_range (Data range of the input tensors.) –

Return type

SSIM loss.

training: bool

Module contents