計算一個或多個矩陣的 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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
