在给定 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的最后两个维度的下三角形部分(包括对角线)。严格的上半部分假定为零且未被访问。 -
rhsATensor,与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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
