简体   繁体   English

Tensorflow中的多维梯度下降

[英]Multidimensional gradient descent in Tensorflow

What does Tensorflow really do when the Gradient descent optimizer is applied to a "loss" placeholder that is not a number (a tensor of size 1) but rather a vector (a 1-dimensional tensor of size 2, 3, 4, or more)? 当将梯度下降优化器应用于不是数字(大小为1的张量)而是向量(大小为2、3、4或更大的一维张量)的“损失”占位符时,Tensorflow真正做什么? )?

Is it like doing the descent on the sum of the components? 就像对总和进行下降一样吗?

The answer to your second question is "no". 您第二个问题的答案是“否”。

As for the second: just like in the one-dimensional case (eg y = f(x), x in R), where the direction the algorithm takes is defined by the derivative of the function with respect to its single variable, in the multidimensional case the 'overall' direction is defined by the derivative of the function with respect to each variable. 至于第二种:就像在一维情况下(例如y = f(x),R中的x)一样,算法采用的方向由函数相对于其单个变量的导数定义。在多维情况下,“总体”方向由函数相对于每个变量的导数定义。

This means the size of the step you'll take in each direction will be determined by the value of the derivative of the variable corresponding to that direction. 这意味着您将在每个方向上执行的步长将由与该方向相对应的变量的导数的值确定。

Since there's no way to properly type math in StackOverflow, instead of messing around with it I'll suggest you take a look at this article . 由于无法在StackOverflow中正确键入数学,因此建议您仔细阅读本文 ,而不是弄乱它。

Tensorflow首先将损失降至标量,然后对其进行优化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM