codecamp

tf.qr函数:计算矩阵的QR分解

tf.qr 函数

别名:

  • tf.linalg.qr
  • tf.qr
qr ( 
    input , 
    full_matrices = False , 
    name = None
 )

请参阅指南:数学函数>矩阵数学函数

计算一个或多个矩阵的 QR 分解.

计算张量中每个内部矩阵的 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)

参数:

  • input:一个 Tensor.必须是下列类型之一:float64,float32,complex64,complex128.一个形状为 [..., M, N] 的张量,其最内2维形成矩阵的大小 [M, N].P 为 M 和 N 的最小值.
  • full_matrices:可选的 bool 值,默认为 False.如果为 true,则计算完整大小 q 和 r.如果为 false(默认),则只计算 q 的前导 P 列.
  • name:操作的名称(可选).

返回:

返回 Tensor 对象的元组(q,r).

  • q:Tensor.与 input 有相同的类型.a 的范围的正交基.如果 full_matrices 是 False,那么形状是 [..., M, P];如果 full_matrices 是 True,那么形状就是 [..., m, m].
  • r:Tensor.与 input 有相同的类型.三角形因子.如果 full_matrices 是 False,那么形状是 [..., P, N].如果 full_matrices 是 True,那么形状是 [..., M, N].
包装用于TensorFlow操作的Python函数
TensorFlow函数:tf.quantized_concat
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }