kstan0725
kstan0725

Reputation: 11

QR decomposition in TensorFlow

I saw that there are methods for doing Cholesky decomposition, and solving linear systems using a QR method in TensorFlow, however, I cannot find a way to implement a QR decomposition in TensorFlow.

How do you perform a QR decomposition in TensorFlow?

Upvotes: 1

Views: 1495

Answers (1)

Danica
Danica

Reputation: 28846

It seems that a QR decomposition is now in tensorflow master; it was added last week.

tf.qr(input, full_matrices=None, name=None)

Computes the QR decompositions of one or more matrices.

Computes the QR decomposition of each inner matrix in tensor such that 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)

Upvotes: 1

Related Questions