mrpro.operators.ProximableFunctionalSeparableSum

class mrpro.operators.ProximableFunctionalSeparableSum[source]

Bases: Operator[Unpack[T], tuple[Tensor]]

Separable Sum of Proximable Functionals.

This is a separable sum of the functionals. The forward method returns the sum of the functionals evaluated at the inputs, \(\sum_i f_i(x_i)\).

__init__(f1: ProximableFunctional, /) None[source]
__init__(f1: ProximableFunctional, f2: ProximableFunctional, /) None
__init__(f1: ProximableFunctional, f2: ProximableFunctional, f3: ProximableFunctional, /) None
__init__(f1: ProximableFunctional, f2: ProximableFunctional, f3: ProximableFunctional, f4: ProximableFunctional, /) None
__init__(f1: ProximableFunctional, f2: ProximableFunctional, f3: ProximableFunctional, f4: ProximableFunctional, f5: ProximableFunctional, /) None
__init__(f1: ProximableFunctional, f2: ProximableFunctional, f3: ProximableFunctional, f4: ProximableFunctional, f5: ProximableFunctional, /, *f: ProximableFunctional) None

Initialize the separable sum of proximable functionals.

Parameters:

functionals (ProximableFunctional) – The proximable functionals to be summed.

__call__(*x: Unpack[T]) tuple[Tensor][source]

Evaluate the sum of separable functionals.

Parameters:

*x (Unpack[TypeVarTuple]) – Input tensors. The number of input tensors must match the number of functionals in the sum.

Returns:

Sum of the functionals applied to their respective inputs.

forward(*x: Unpack[T]) tuple[Tensor][source]

Apply forward of ProximableFunctionalSeparableSum.

Note

Prefer calling the instance of the ProximableFunctionalSeparableSum operator as operator(x) over directly calling this method. See this PyTorch discussion.

prox(*x: Unpack[T], sigma: float | Tensor = 1) tuple[Unpack[T]][source]

Apply the proximal operators of the functionals to the inputs.

Parameters:
  • x (Unpack[TypeVarTuple]) – The inputs to the proximal operators

  • sigma (float | Tensor, default: 1) – The scaling factor for the proximal operators

Returns:

A tuple of the proximal operators applied to the inputs

prox_convex_conj(*x: Unpack[T], sigma: float | Tensor = 1) tuple[Unpack[T]][source]

Apply the proximal operators of the convex conjugate of the functionals to the inputs.

Parameters:
  • x (Unpack[TypeVarTuple]) – The inputs to the proximal operators

  • sigma (float | Tensor, default: 1) – The scaling factor for the proximal operators

Returns:

A tuple of the proximal convex conjugate operators applied to the inputs

__or__(other: ProximableFunctional) ProximableFunctionalSeparableSum[Unpack[T], Tensor][source]
__or__(other: ProximableFunctionalSeparableSum[Tensor]) ProximableFunctionalSeparableSum[Unpack[T], Tensor]
__or__(other: ProximableFunctionalSeparableSum[Tensor, Tensor]) ProximableFunctionalSeparableSum[Unpack[T], Tensor, Tensor]
__or__(other: ProximableFunctionalSeparableSum[Tensor, Tensor, Tensor]) ProximableFunctionalSeparableSum[Unpack[T], Tensor, Tensor, Tensor]
__or__(other: ProximableFunctionalSeparableSum[Tensor, Tensor, Tensor, Tensor]) ProximableFunctionalSeparableSum[Unpack[T], Tensor, Tensor, Tensor, Tensor]
__or__(other: ProximableFunctionalSeparableSum[Tensor, Tensor, Tensor, Tensor, Tensor]) ProximableFunctionalSeparableSum[Unpack[T], Tensor, Tensor, Tensor, Tensor, Tensor]

Separable sum functionals.

__ror__(other: ProximableFunctional) ProximableFunctionalSeparableSum[Tensor, Unpack[T]][source]

Separable sum functionals.

__add__(other: Operator[Unpack[Tin], Tout]) Operator[Unpack[Tin], Tout][source]
__add__(other: Tensor | complex) Operator[Unpack[Tin], tuple[Unpack[Tin]]]

Operator addition.

Returns lambda x: self(x) + other(x) if other is a operator, lambda x: self(x) + other*x if other is a tensor

__matmul__(other: Operator[Unpack[Tin2], tuple[Unpack[Tin]]] | Operator[Unpack[Tin2], tuple[Tensor, ...]]) Operator[Unpack[Tin2], Tout][source]

Operator composition.

Returns lambda x: self(other(x))

__mul__(other: Tensor | complex) Operator[Unpack[Tin], Tout][source]

Operator multiplication with tensor.

Returns lambda x: self(x*other)

__radd__(other: Tensor | complex) Operator[Unpack[Tin], tuple[Unpack[Tin]]][source]

Operator right addition.

Returns lambda x: other*x + self(x)

__rmul__(other: Tensor | complex) Operator[Unpack[Tin], Tout][source]

Operator multiplication with tensor.

Returns lambda x: other*self(x)