计算一个或多个矩阵的 QR 分解。
用法
tf.linalg.qr(
input, full_matrices=False, name=None
)参数
-
input一个Tensor。必须是以下类型之一:float64,float32,half,complex64,complex128。形状为[..., M, N]的张量,其 inner-most 2 维形成大小为[M, N]的矩阵。令P为M和N的最小值。 -
full_matrices可选的bool。默认为False。如果为真,则计算全尺寸q和r。如果为 false(默认值),则仅计算q的前导P列。 -
name操作的名称(可选)。
返回
-
Tensor对象 (q, r) 的元组。 -
q一个Tensor。具有与input相同的类型。 -
r一个Tensor。具有与input相同的类型。
计算 tensor 中每个内部矩阵的 QR 分解,使得 tensor[...,:,:] = q[...,:,:] * r[...,:,:])
目前,仅当内部矩阵的前 P 列线性无关时,QR 分解的梯度才明确定义,其中 P 是 M 和 N 的最小值,即 2 个 inner-most 维度tensor 的。
# a is a tensor.
# q is a tensor of orthonormal matrices.
# r is a tensor of upper triangular matrices.
q, r = qr(a)
q_full, r_full = qr(a, full_matrices=True)
相关用法
- Python tf.linalg.LinearOperatorFullMatrix.matvec用法及代码示例
- Python tf.linalg.LinearOperatorToeplitz.solve用法及代码示例
- Python tf.linalg.LinearOperatorIdentity.solvevec用法及代码示例
- Python tf.linalg.LinearOperatorPermutation.solve用法及代码示例
- Python tf.linalg.band_part用法及代码示例
- Python tf.linalg.LinearOperatorKronecker.diag_part用法及代码示例
- Python tf.linalg.lu_matrix_inverse用法及代码示例
- Python tf.linalg.LinearOperatorToeplitz.matvec用法及代码示例
- Python tf.linalg.LinearOperatorBlockLowerTriangular.solvevec用法及代码示例
- Python tf.linalg.LinearOperatorLowerTriangular.matvec用法及代码示例
- Python tf.linalg.LinearOperatorCirculant2D.solve用法及代码示例
- Python tf.linalg.LinearOperatorCirculant3D.diag_part用法及代码示例
- Python tf.linalg.LinearOperatorToeplitz.solvevec用法及代码示例
- Python tf.linalg.LinearOperatorCirculant2D.assert_non_singular用法及代码示例
- Python tf.linalg.LinearOperatorPermutation.diag_part用法及代码示例
- Python tf.linalg.LinearOperatorToeplitz用法及代码示例
- Python tf.linalg.LinearOperatorCirculant2D.matvec用法及代码示例
- Python tf.linalg.LinearOperatorTridiag.solvevec用法及代码示例
- Python tf.linalg.LinearOperatorTridiag.solve用法及代码示例
- Python tf.linalg.LinearOperatorZeros.matmul用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.linalg.qr。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
