用法
solve(
rhs, adjoint=False, adjoint_arg=False, name='solve'
)
参数
-
rhs
Tensor
具有与此运算符相同的dtype
和兼容的形状,或Tensor
的列表。Tensor
s 被视为 [batch] 矩阵,这意味着每组前导维度,最后两个维度定义一个矩阵。有关兼容性的定义,请参见类文档字符串。 -
adjoint
Pythonbool
。如果True
,求解涉及此LinearOperator
的伴随系统:A^H X = rhs
。 -
adjoint_arg
Pythonbool
。如果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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。