Tensorflow.js tf.linalg.qr() Function
The .linalg.qr() function is used to calculate the QR decomposition referring to m by n matrix applying Householder transformation.
- x: The stated tf.Tensor which is to be QR-decomposed. It must have a rank greater than or equal to 2. Assume, its shape as […, M, N]. It is of type tf.Tensor.
- fullMatrices: It is an optional parameter and is of type boolean whose by default value is false. In case it’s true, then it evaluates normal-sized Q else it evaluates just the highest N columns of Q and R.
Return Value: It returns [tf.Tensor, tf.Tensor].
q Tensor [[-0.3939192, 0.919145 ], [-0.919145 , -0.3939193]] r Tensor [[-7.6157722, -3.8078861], [0 , 3.8078861 ]]
Orthogonalized: Tensor [[-0.3939192, -0.919145 ], [0.919145 , -0.3939193]] Regenerated: Tensor [[6.4999986 , -5.499999 ], [-3.4999995, -1.4999998]]