在給定 Cholesky 分解的情況下,求解線性 eqns A X = RHS
係統。
用法
tf.linalg.cholesky_solve(
chol, rhs, name=None
)
參數
-
chol
一個Tensor
。必須是float32
或float64
,形狀是[..., M, M]
。A
的 Cholesky 分解,例如chol = tf.linalg.cholesky(A)
。因此,僅使用chol
的最後兩個維度的下三角形部分(包括對角線)。嚴格的上半部分假定為零且未被訪問。 -
rhs
ATensor
,與chol
相同類型,形狀為[..., M, K]
。 -
name
給這個Op
的名稱。默認為cholesky_solve
。
返回
-
A x = rhs
的解決方案,形狀[..., M, K]
。
具體來說,從 A X = RHS
返回 X
,其中 A = L L^T
, L
是 chol
arg 並且 RHS
是 rhs
arg。
# Solve 10 separate 2x2 linear systems:
A = ... # shape 10 x 2 x 2
RHS = ... # shape 10 x 2 x 1
chol = tf.linalg.cholesky(A) # shape 10 x 2 x 2
X = tf.linalg.cholesky_solve(chol, RHS) # shape 10 x 2 x 1
# tf.matmul(A, X) ~ RHS
X[3,:, 0] # Solution to the linear system A[3,:,:] x = RHS[3,:, 0]
# Solve five linear systems (K = 5) for every member of the length 10 batch.
A = ... # shape 10 x 2 x 2
RHS = ... # shape 10 x 2 x 5
...
X[3,:, 2] # Solution to the linear system A[3,:,:] x = RHS[3,:, 2]
相關用法
- 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.cholesky_solve。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。