Skip to content

Chapter 3. Programs as Mathematical Objects

A straight-line program is the simplest model of computation used in automatic differentiation. It is a program with a fixed sequence of assignments, no branches, no loops,...

SectionTitle
1Chapter 3. Programs as Mathematical Objects
2Intermediate Variables
3Dependency Graphs
4Control Flow
5Loops and Recurrence Relations
6Memory and State
7Purity and Side Effects
8Differentiable Subprograms
Chapter 3. Programs as Mathematical ObjectsA straight-line program is the simplest model of computation used in automatic differentiation. It is a program with a fixed sequence of assignments, no branches, no loops,...
6 min
Intermediate VariablesIntermediate variables are the named values created between program inputs and program outputs. They make automatic differentiation mechanical.
6 min
Dependency GraphsA dependency graph describes how values in a computation depend on earlier values. Automatic differentiation operates on these dependencies.
6 min
Control FlowControl flow determines which operations a program executes. Straight-line programs have a fixed sequence of operations, but ordinary programs contain branches, loops,...
7 min
Loops and Recurrence RelationsLoops express repeated computation. Recurrence relations express the same idea mathematically: each state is computed from one or more earlier states.
6 min
Memory and StateAutomatic differentiation operates on computations, but computations execute inside a memory model. Variables occupy storage locations, arrays are mutated, buffers are reused,...
7 min
Purity and Side EffectsA pure computation is easier to differentiate because every output is determined only by its explicit inputs. There is no hidden state, no external mutation, and no dependence...
7 min
Differentiable SubprogramsA differentiable subprogram is a program fragment that can participate in derivative propagation as a coherent unit. Instead of differentiating an entire application...
6 min