bartorch.linop.ScaledSum

bartorch.linop.ScaledSum#

class bartorch.linop.ScaledSum(shape, axes)#

Sum over axes, divided by the square root of how many were summed.

BART’s linop_scaled_sum. The scaling is what makes it well behaved: its normal operator is an orthogonal projection rather than a multiple of one, so its spectral norm is one and pinv() has a closed form – BART solves (A^H A + damp I) x = A^H y here directly, with no iteration.

Sum is the plain sum, which is what a reader usually wants; this is the one to reach for inside a solver, where the conditioning and the exact inverse are worth the factor.

Parameters:
  • shape (tuple of int) – The shape it sums over, C order.

  • axes (int or tuple of int) – Which axes to sum, as indices into shape.

__init__(shape, axes)#

Methods

A(x, **kwargs)

A x, under deepinv's name.

A_adjoint(y, **kwargs)

A^H y, under deepinv's name, recorded for autograd.

A_adjoint_A(x, **kwargs)

A^H A x, under deepinv's name, recorded for autograd.

A_dagger(y, **kwargs)

The pseudo-inverse, under deepinv's name.

__init__(shape, axes)

adjoint(y[, out])

A^H y, without recording for autograd.

cogram()

A A^H as an operator.

conj()

conj(A): conjugate the input, apply, conjugate the output.

forward(x[, out])

A x, without recording for autograd.

gram()

A^H A as an operator.

normal(x[, out])

A^H A x.

opnorm()

The spectral norm, by BART's power iteration on A^H A.

pinv(y[, damp])

(A^H A + damp I)^-1 A^H y, the damped least-squares solution.

to_nonlinear()

The same operator as a NonlinearOperator.

Attributes

H

A^H, from BART's own adjoint constructor.

T

A^T, the adjoint without the conjugation, as conj(A).H.

codim_rank

How many axes the codomain has.

codim_shape

The codomain, under pyxu's name for it; the same as oshape.

codim_size

How many elements the codomain holds.

device

dim_rank

How many axes the domain has.

dim_shape

The domain, under pyxu's name for it; the same as ishape.

dim_size

How many elements the domain holds.

ishape

oshape