我看到有一些方法可以做Cholesky分解,并在TensorFlow中使用QR方法求解线性系统,但是,我找不到在TensorFlow中实现QR分解的方法。
如何在TensorFlow中执行QR分解?
看起来QR分解现在在tensorflow master中;
tf.qr(input, full_matrices=None, name=None)
计算一个或多个矩阵的QR分解。
计算
tensor
中每个内矩阵的QR分解,使tensor[..., :, :] = q[..., :, :] * r[..., :,:])
# 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)