3.1.10 · D1Neural Network Fundamentals

Foundations — Computational graphs and autograd

2,009 words9 min readBack to topic

This page assumes nothing. We collect every symbol, arrow, and word the parent note (Computational graphs and autograd) leans on, and we build each from a picture before you ever need it.


0. What a function really is (the machine picture)

Before any fancy notation, picture a machine with a knob and a screen. You set the knob to a number ; the machine grinds and shows a number on the screen. We write this as — read "f of x", meaning "the output the machine produces when fed ".

Figure — Computational graphs and autograd

Why the topic needs this: the whole point of the parent note is that a neural network is a function — just a giant one made of many small machines wired together. If you can picture one machine, you can picture a thousand wired in a chain.


1. Variables and the arrow

The parent writes things like and . Two pieces of notation hide here.

  • names the result of an operation. Think of as a labelled wire carrying the value . It is a variable — a box that currently holds a number.
  • (an arrow) means " is used to build ". The arrow points in the direction the value flows: from an ingredient to the thing made from it.

Why the topic needs this: the entire computational graph is drawn from these arrows. Forward = follow arrows; backward = go against them.


2. The graph, the DAG, and "nodes / edges"

Figure — Computational graphs and autograd

Why acyclic matters: if the graph had a loop, a value would depend on itself and there would be no order to compute in. No loops ⇒ there is always a clean left-to-right ordering, which is exactly what lets the forward pass and backward pass proceed step by step.

Why the topic needs this: "computational graph = DAG" is the parent's first definition. Every other idea (forward pass, backward pass) is walking this DAG in one direction or the other.


3. The primitives: , , ,

The parent breaks a big function into elementary operations (primitives). You already know most:

Symbol Plain words Picture
add the two numbers two lengths laid end to end
or multiply area of a rectangle, sides and
height on a spinning circle vertical position of a point going round a unit circle at angle
the exponential a curve that shrinks fast toward 0 as grows

Why the topic needs this: we only know how to differentiate simple things. Chop the monster into primitives, differentiate each one locally, then glue — that gluing is the chain rule (Section 6).


4. The derivative — "how much wiggle out per wiggle in"

This is the heart. Wiggle the input knob by a tiny amount; watch how much the screen moves.

Figure — Computational graphs and autograd

The picture: draw the output curve, zoom into one point until the curve looks like a straight line, and measure its slope = rise over run. A steep slope means a small input wiggle causes a big output wiggle.

The known local derivatives you'll reuse:


5. Partial derivatives — the curly d

When a machine has two knobs , "the derivative" is ambiguous — derivative with respect to which knob? The curly answers that.

Why the topic needs this: a weight in a network is one knob among millions. We want the wiggle-effect of each knob separately — that is a partial derivative for every weight.


6. The chain rule — gluing local wiggles

Two machines in a row: . If wiggling moves by a factor , and wiggling moves by a factor , then wiggling moves by the product.

When reaches through several paths, you add the paths (this is the multivariable version):

Figure — Computational graphs and autograd

Why multiply along a path, add across paths? Multiply: sensitivities compound through a chain (like gear ratios in series). Add: independent routes each contribute their own wiggle, and total wiggle is the sum. This single sentence is the mathematical seed of the entire Backpropagation algorithm — see also Chain rule (multivariable calculus).


7. The adjoint / bar and the notation

The parent writes and . Now everything is in place to read it.

  • ("v-bar", the adjoint) is short for — the sensitivity of the final output to node . It is just a partial derivative with a nickname because we compute so many of them.
  • (read "plus-equals", borrowed from programming) means "add this to what's already stored", i.e. . It appears because a shared node's total sensitivity is the sum over paths from Section 6.

Why the topic needs this: the whole backward pass is: seed (the output is perfectly sensitive to itself), then push bars backward through each edge, accumulating with . That is reverse-mode automatic differentiation.


8. The sigmoid

The neuron example uses . Read it as a squashing machine: feed any real number , get a number strictly between and (a "probability-like" value).

Its derivative has a famously clean form used in the parent's neuron: Why the topic cares: this tidy derivative is exactly the "known local derivative" the backward pass multiplies in.


Prerequisite map

Function f of x

Variable and arrow

Graph node and edge DAG

Primitives add mult sin exp

Derivative slope

Partial derivative curly d

Chain rule multiply along add across

Computational graph

Sigmoid squash

Autograd forward and backward

Backpropagation and Gradient descent

Read top-to-bottom: pictures of functions and arrows build the graph; slope and chain rule build the derivative machinery; together they power autograd, which drives training.


Equipment checklist

Test yourself — cover the right side and answer aloud.

I can read and say what a two-input function is
A rule turning each pair of inputs into one output; picture: a machine with two knobs and one screen.
I know what the arrow means
" is built from "; the arrow shows the direction the value flows.
I can state why a computational graph must be acyclic
No loops means every value has a computation order; otherwise a value would depend on itself.
I can explain a derivative in wiggle language
How many times bigger the output wiggle is than a tiny input wiggle; it is the slope of the output curve.
I know why is curly, not straight
It signals we wiggle one variable while freezing all others (a partial derivative).
I can state the chain rule for one path and for many paths
One path: multiply local derivatives; many paths: also sum across the paths.
I can decode and
(sensitivity of output to ); adds a new contribution because shared nodes sum over paths.
I know the primitive derivatives of
; the other factor; ; .
I can describe the sigmoid's shape and range
An S-curve squashing any real number into , equal to at ; derivative .
Recall Why this page comes before everything else

Every line of the parent note reuses these nine symbols. If any one is fuzzy, the backward-pass algebra becomes memorized noise. Once each symbol is a picture, the parent's chain-rule bookkeeping reads like plain English.