Home / Deep learning / Automatic differentiation / Method
Diagram
\begin{tikzpicture}
\usetikzlibrary{positioning};
\usetikzlibrary{arrows.meta};
\tikzset{> = {Straight Barb}};
\node (root);
\node [draw, above = of root] (x) {$x = 1$};
\node [draw, below = of root] (y) {$y = 2$};
\node [draw, right = 10em of x] (a) {$a = x + y = 3$};
\node [draw, right = 10em of y] (b) {$b = y + 3 = 5$};
\node [draw, right = 25em of root] (c) {$c = ab = 15$};
\draw[->] (x.east) -- (a.west)
node [midway, above]
{$\frac{\partial a}{\partial x} = 1$};
\draw[->] (y.east) -- (b.west)
node [midway, below]
{$\frac{\partial b}{\partial y} = 1$};
\draw[->] (x.east) -- (b.west)
node [midway, sloped, below, xshift = 2em]
{$\frac{\partial b}{\partial x} = 0$};
\draw[->] (y.east) -- (a.west)
node [midway, sloped, above, xshift = 2em]
{$\frac{\partial a}{\partial y} = 1$};
\draw[->] (a.east) -- (c.west)
node [midway, sloped, above]
{$\frac{\partial c}{\partial a} = 5$};
\draw[->] (b.east) -- (c.west)
node [midway, sloped, below]
{$\frac{\partial c}{\partial b} = 3$};
\end{tikzpicture}