用法
solve(
rhs, adjoint=False, adjoint_arg=False, name='solve'
)參數
-
rhsTensor具有與此運算符相同的dtype和兼容的形狀,或Tensor的列表。Tensors 被視為 [batch] 矩陣,這意味著每組前導維度,最後兩個維度定義一個矩陣。有關兼容性的定義,請參見類文檔字符串。 -
adjointPythonbool。如果True,求解涉及此LinearOperator的伴隨係統:A^H X = rhs。 -
adjoint_argPythonbool。如果True,求解A X = rhs^H其中rhs^H是厄米轉置(轉置和複共軛)。 -
name用於此方法添加的操作的名稱範圍。
返回
-
Tensor形狀為[...,N, R]並且dtype與rhs相同。
拋出
-
NotImplementedError如果self.is_non_singular或is_square為 False。
求解(精確或近似)R(批量)方程組:A X = rhs。
如果 A 條件良好,則返回的 Tensor 將接近精確解。否則親密度會有所不同。有關詳細信息,請參閱類文檔字符串。
給定分塊 n + 1 -by- n + 1 線性運算符:
op = [[A_00 0 ... 0 ... 0],[A_10 A_11 ... 0 ... 0],... [A_k0 A_k1 ... A_kk ... 0],... [A_n0 A_n1 ... A_nk ... A_nn]]
我們通過觀察發現x = op.solve(y)
y_k = A_k0.matmul(x_0) + A_k1.matmul(x_1) + ... + A_kk.matmul(x_k)
因此
x_k = A_kk.solve(y_k -
A_k0.matmul(x_0) - ... - A_k(k-1).matmul(x_(k-1)))
其中x_k和y_k是通過沿相應軸分解x和y獲得的第k塊。
我們首先解決 x_0 = A_00.solve(y_0) 。繼續歸納,我們求解 x_k , k = 1..n ,給定 x_0..x_(k-1) 。
伴隨情況以類似的方式解決,從x_n = A_nn.solve(y_n, adjoint=True) 開始並向後進行。
例子:
# Make an operator acting like batch matrix A. Assume A.shape = [..., M, N]
operator = LinearOperator(...)
operator.shape = [..., M, N]
# Solve R > 0 linear systems for every member of the batch.
RHS = ... # shape [..., M, R]
X = operator.solve(RHS)
# X[...,:, r] is the solution to the r'th linear system
# sum_j A[...,:, j] X[..., j, r] = RHS[...,:, r]
operator.matmul(X)
==> RHS
相關用法
- Python tf.linalg.LinearOperatorBlockLowerTriangular.solvevec用法及代碼示例
- Python tf.linalg.LinearOperatorBlockLowerTriangular.matmul用法及代碼示例
- Python tf.linalg.LinearOperatorBlockLowerTriangular.diag_part用法及代碼示例
- Python tf.linalg.LinearOperatorBlockLowerTriangular.assert_non_singular用法及代碼示例
- Python tf.linalg.LinearOperatorBlockLowerTriangular.matvec用法及代碼示例
- Python tf.linalg.LinearOperatorBlockLowerTriangular用法及代碼示例
- Python tf.linalg.LinearOperatorBlockDiag.diag_part用法及代碼示例
- Python tf.linalg.LinearOperatorBlockDiag.assert_non_singular用法及代碼示例
- Python tf.linalg.LinearOperatorBlockDiag.matmul用法及代碼示例
- Python tf.linalg.LinearOperatorBlockDiag.solvevec用法及代碼示例
- Python tf.linalg.LinearOperatorBlockDiag.matvec用法及代碼示例
- Python tf.linalg.LinearOperatorBlockDiag用法及代碼示例
- Python tf.linalg.LinearOperatorBlockDiag.solve用法及代碼示例
- Python tf.linalg.LinearOperatorFullMatrix.matvec用法及代碼示例
- Python tf.linalg.LinearOperatorToeplitz.solve用法及代碼示例
- Python tf.linalg.LinearOperatorIdentity.solvevec用法及代碼示例
- Python tf.linalg.LinearOperatorPermutation.solve用法及代碼示例
- Python tf.linalg.LinearOperatorKronecker.diag_part用法及代碼示例
- Python tf.linalg.LinearOperatorToeplitz.matvec用法及代碼示例
- Python tf.linalg.LinearOperatorLowerTriangular.matvec用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.linalg.LinearOperatorBlockLowerTriangular.solve。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
