mrpro.operators.ScaledProximableFunctional

class mrpro.operators.ScaledProximableFunctional[source]

Bases: ProximableFunctional

Proximable Functional scaled by a scalar.

__init__(functional: ProximableFunctional, scale: Tensor | float) None[source]

Initialize a scaled proximable functional.

A scaled functional is a functional that is scaled by a scalar factor \(\alpha\), i.e. \(f(x) = \alpha g(x)\).

Parameters:
__call__(x: Tensor) tuple[Tensor][source]

Apply the functional.

Parameters:

x (Tensor) – input tensor

Returns:

scaled output of the functional

forward(x: Tensor) tuple[Tensor][source]

Apply the functional.

Note

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

prox(x: Tensor, sigma: Tensor | float = 1.0) tuple[Tensor][source]

Proximal Mapping.

Parameters:
  • x (Tensor) – input tensor

  • sigma (Tensor | float, default: 1.0) – scaling factor

Returns:

Proximal mapping applied to the input tensor

prox_convex_conj(x: Tensor, sigma: Tensor | float = 1.0) tuple[Tensor][source]

Proximal Mapping of the convex conjugate.

Parameters:
  • x (Tensor) – input tensor

  • sigma (Tensor | float, default: 1.0) – scaling factor

Returns:

Proximal mapping of the convex conjugate applied to the input tensor

__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)

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

Create a ProximableFunctionalSeparableSum object from two proximable functionals.

Parameters:

other (ProximableFunctional) – second functional to be summed

Returns:

ProximableFunctionalSeparableSum object

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

Operator right addition.

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

__rmul__(scalar: Tensor | complex) ProximableFunctional[source]

Multiply functional with scalar.