Tensorflow 哪些操作是可微的,哪些不是? [英] Tensorflow what operations are differentiable and what are not?

查看:54
本文介绍了Tensorflow 哪些操作是可微的,哪些不是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Tensorflow 中,很难确定函数是否可微.例如, tf.argmax 是不可微的.我想知道是否有任何文档可以指定哪些操作是可微分的?

In Tensorflow, it is hard to figure out if a function is differentiable or not. For instance, tf.argmax is not differentiable. I am wondering is there any documentation to specify which operations is differentiable?

推荐答案

对于数学运算,梯度被注册在这个文件中:tensorflow/tensorflow/python/ops/math_grad.py

For math operation, the gradients are registered in this file: tensorflow/tensorflow/python/ops/math_grad.py

例如tf.argmax的梯度:

@ops.RegisterGradient("ArgMax")
def _ArgMaxGrad(op, grad):
  del op, grad
  return [None, None]

其他操作的渐变也可以在同一文件夹中找到.

Gradients for other operation can also be found in the same folder.

这篇关于Tensorflow 哪些操作是可微的,哪些不是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆