linalg_householder_product {torch} | R Documentation |
n
columns of a product of Householder matrices.Letting \mathbb{K}
be \mathbb{R}
or \mathbb{C}
,
for a matrix V \in \mathbb{K}^{m \times n}
with columns v_i \in \mathbb{K}^m
with m \geq n
and a vector \tau \in \mathbb{K}^k
with k \leq n
,
this function computes the first n
columns of the matrix
linalg_householder_product(A, tau)
A |
(Tensor): tensor of shape |
tau |
(Tensor): tensor of shape |
Math could not be displayed. Please visit the package website.
where \mathrm{I}_m
is the m
-dimensional identity matrix and
v^{H}
is the conjugate transpose when v
is complex, and the transpose when v
is real-valued.
See Representation of Orthogonal or Unitary Matrices for
further details.
Supports inputs of float, double, cfloat and cdouble dtypes. Also supports batches of matrices, and if the inputs are batches of matrices then the output has the same batch dimensions.
This function only uses the values strictly below the main diagonal of A
.
The other values are ignored.
torch_geqrf()
can be used together with this function to form the Q
from the
linalg_qr()
decomposition.
torch_ormqr()
is a related function that computes the matrix multiplication
of a product of Householder matrices with another matrix.
However, that function is not supported by autograd.
Other linalg:
linalg_cholesky_ex()
,
linalg_cholesky()
,
linalg_det()
,
linalg_eigh()
,
linalg_eigvalsh()
,
linalg_eigvals()
,
linalg_eig()
,
linalg_inv_ex()
,
linalg_inv()
,
linalg_lstsq()
,
linalg_matrix_norm()
,
linalg_matrix_power()
,
linalg_matrix_rank()
,
linalg_multi_dot()
,
linalg_norm()
,
linalg_pinv()
,
linalg_qr()
,
linalg_slogdet()
,
linalg_solve_triangular()
,
linalg_solve()
,
linalg_svdvals()
,
linalg_svd()
,
linalg_tensorinv()
,
linalg_tensorsolve()
,
linalg_vector_norm()
if (torch_is_installed()) {
A <- torch_randn(2, 2)
h_tau <- torch_geqrf(A)
Q <- linalg_householder_product(h_tau[[1]], h_tau[[2]])
torch_allclose(Q, linalg_qr(A)[[1]])
}