codecamp

Hessian函数

函数:tf.hessians
hessians(
    ys,
    xs,
    name='hessians',
    colocate_gradients_with_ops=False,
    gate_gradients=False,
    aggregation_method=None
)

定义在:tensorflow/python/ops/gradients_impl.py.

参见指南:Training函数>梯度计算

构造在 xs 中与 x 有关的和 ys 的总和的 Hessian.

hessians () 将 ops 添加到图形中,以便输出与 xs 有关的 ys 的 Hessian 矩阵.它返回长度为 len (xs) 的张量的列表,其中每个张量是 Hessian 的 sum(ys).这个函数目前只支持在一个一维张量的列表中对 Hessian 进行评估.

Hessian 是一个标量张量的二阶偏导数矩阵 (您可以参考:https://en.wikipedia.org/wiki/Hessian_matrix 获取更多的细节).

参数:

  • ys:需要区分的张量或者张量列表.
  • xs:用于微分的张量或者张量列表.
  • name:用于将所有梯度操作分组在一起的可选名称.默认为:'hessian'.
  • colocate_gradients_with_ops:有关详细信息,参考 gradients() 文档说明.
  • gate_gradients:详见 gradients() 文档说明.
  • aggregation_method:详见 gradients() 文档说明.

返回值:

该函数返回 xs 中每个 x 的 sum(ys) 的 Hessian 矩阵列表.

可能引发的异常:

  • LookupError:如果 xs 和 ys 之间的某个操作不是已注册的梯度函数.
TensorFlow流程控制函数:tf.group
TensorFlow逆向快速傅里叶变换函数
温馨提示
下载编程狮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; }