bartorch.linop.Matrix#
- class bartorch.linop.Matrix(matrix, oshape, ishape)#
Multiplication by a matrix along one axis, BART’s
linop_matrix.The matrix is an array like any other: it contracts the axis the domain and the codomain differ along and broadcasts over the axes it has only one of, so one operator can carry a different matrix per slice.
- Parameters:
matrix (tensor) – The matrix, with the domain’s size along the axis it contracts and the codomain’s along the axis it produces.
oshape (tuple of int) – Codomain and domain, C order, with the same number of axes.
ishape (tuple of int) – Codomain and domain, C order, with the same number of axes.
Examples
A basis of
kfunctions overtsamples, applied along the first axis of(t, y, x):>>> B = Matrix(basis, (k, y, x), (t, y, x))
- __init__(matrix, oshape, ishape)#
Methods
A(x, **kwargs)A x, underdeepinv's name.A_adjoint(y, **kwargs)A^H y, underdeepinv's name, recorded for autograd.A_adjoint_A(x, **kwargs)A^H A x, underdeepinv's name, recorded for autograd.A_dagger(y, **kwargs)The pseudo-inverse, under
deepinv's name.__init__(matrix, oshape, ishape)adjoint(y[, out])A^H y, without recording for autograd.cogram()A A^Has an operator.conj()conj(A): conjugate the input, apply, conjugate the output.forward(x[, out])A x, without recording for autograd.gram()A^H Aas 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
HA^H, from BART's own adjoint constructor.TA^T, the adjoint without the conjugation, asconj(A).H.codim_rankHow many axes the codomain has.
codim_shapeThe codomain, under pyxu's name for it; the same as
oshape.codim_sizeHow many elements the codomain holds.
devicedim_rankHow many axes the domain has.
dim_shapeThe domain, under pyxu's name for it; the same as
ishape.dim_sizeHow many elements the domain holds.
ishapeoshape