f(x) = x*x + x - 2
Graph =
ADD
/ \
MUL SUB
/ \ / \
x x x 2
Chain rule for ADD=> (a(x)+b(x))' = a'(x) + b'(x)
Chain rule for MUL=> (a(x)*b(x))' = a'(x)*b(x) + a(x)*b'(x)
Chain rule for SUB=> (a(x)-b(x))' = a'(x) - b'(x)
The derivative of x is 1, and the derivative of a constant is 0.
Derivative graph (not optimized yet) =
ADD
/ \
ADD SUB
/ | | \
MUL MUL 1 0
/ | | \
1 x x 1
Derivative graph (after optimization) =
ADD
/ \
MUL 1
/ \
2 x
So: f'(x) = 2*x + 1
theano的T.grad如何计算
最新推荐文章于 2022-10-09 21:09:30 发布
本文通过具体例子展示了如何对一元函数f(x)=x*x+x-2进行求导,并给出了详细的步骤说明及最终的导数表达式。
2836

被折叠的 条评论
为什么被折叠?



