Skip to content

Auto Diff

Auto Diff book notes exported from ChatGPT, organized into 22 chapters.

ChapterTitleDescription
1Chapter 1. IntroductionA derivative measures how an output changes when an input changes. That sentence is simple, but it is one of the main ideas behind numerical computing, optimization, machine…
2Chapter 2. Mathematical FoundationsAutomatic differentiation begins with a simple object: a function.
3Chapter 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,…
4Chapter 4. Core Theory of Automatic DifferentiationAutomatic differentiation is built on a simple observation: a complicated derivative can be computed by composing many small local derivatives. Instead of manipulating a full…
5Chapter 5. Forward Mode Automatic DifferentiationForward mode automatic differentiation computes derivatives by carrying two values through a program at the same time: the ordinary value and its tangent. The ordinary value…
6Chapter 6. Reverse Mode Automatic DifferentiationReverse mode automatic differentiation computes derivatives by propagating sensitivities backward through a computation. In forward mode, each intermediate value carries a…
7Chapter 7. Dual Numbers and Algebraic StructuresDual numbers give the cleanest algebraic model of forward mode automatic differentiation. They extend ordinary real numbers with a formal infinitesimal part. Instead of…
8Chapter 8. Higher-Order DifferentiationFirst derivatives describe local rate of change. Second derivatives describe how that rate of change itself changes. In optimization, this is curvature. In dynamics, it is…
9Chapter 9. Differentiation of Control FlowA conditional is a program construct that chooses one computation among several possible computations. In ordinary code, this is written as if, else, switch, case, pattern…
10Chapter 10. Matrix and Tensor DifferentiationMatrix calculus is the notation and rule system used to differentiate functions whose inputs, outputs, or intermediate values are vectors, matrices, or tensors. Automatic…
11Chapter 11. Compiler and Runtime DesignSource transformation is an implementation strategy for automatic differentiation in which a program that computes a function is rewritten into another program that computes…
12Chapter 12. AD in Modern Programming LanguagesLisp is one of the natural homes of automatic differentiation. It treats programs as data, has a simple expression syntax, and supports macro systems that can transform code…
13Chapter 13. Optimization and Machine LearningGradient descent is the basic optimization procedure behind much of modern machine learning. It is simple enough to state in one line, but rich enough to expose many of the…
14Chapter 14. Scientific Computing ApplicationsDifferential equations are one of the main reasons automatic differentiation matters in scientific computing. Many scientific models are not written as closed-form functions….
15Chapter 15. Differentiable Systems ArchitectureAn end-to-end differentiable pipeline is a system whose final objective can send derivative information backward through every trainable or tunable stage of computation….
16Chapter 16. Sparse and Structured DifferentiationSparse and structured differentiation studies how to compute derivatives without materializing dense derivative objects. Many real systems have enormous Jacobians and…
17Chapter 17. Numerical and Systems ConcernsAutomatic differentiation computes derivatives by executing arithmetic. On a real machine, arithmetic uses finite precision. This means AD gives the derivative of the…
18Chapter 18. Advanced TopicsMany programs do not compute their output by applying a fixed sequence of explicit operations. Instead, they define the output as the solution of another problem.
19Chapter 19. Theory and FoundationsAutomatic differentiation is often described by a simple rule:
20Chapter 20. Building an AD EngineA minimal forward mode automatic differentiation engine has one job: evaluate a program while carrying both a value and its derivative. The engine does not build a graph. It…
21Chapter 21. Major AD SystemsADIFOR, short for Automatic Differentiation of Fortran, is one of the classical source-transformation systems for automatic differentiation. It was designed for numerical…
22Chapter 22. Open ProblemsAutomatic differentiation works naturally on pure mathematical functions:
AppendixAppendixADIFOR, short for Automatic Differentiation of Fortran, is one of the classical source-transformation systems for automatic differentiation. It was designed for numerical…
Chapter 1. IntroductionA derivative measures how an output changes when an input changes. That sentence is simple, but it is one of the main ideas behind numerical computing, optimization, machine...
7 pages · 46 min
Chapter 2. Mathematical FoundationsAutomatic differentiation begins with a simple object: a function.
8 pages · 54 min
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,...
8 pages · 51 min
Chapter 4. Core Theory of Automatic DifferentiationAutomatic differentiation is built on a simple observation: a complicated derivative can be computed by composing many small local derivatives. Instead of manipulating a full...
10 pages · 55 min
Chapter 5. Forward Mode Automatic DifferentiationForward mode automatic differentiation computes derivatives by carrying two values through a program at the same time: the ordinary value and its tangent. The ordinary value...
9 pages · 62 min
Chapter 6. Reverse Mode Automatic DifferentiationReverse mode automatic differentiation computes derivatives by propagating sensitivities backward through a computation. In forward mode, each intermediate value carries a...
10 pages · 62 min
Chapter 7. Dual Numbers and Algebraic StructuresDual numbers give the cleanest algebraic model of forward mode automatic differentiation. They extend ordinary real numbers with a formal infinitesimal part. Instead of...
9 pages · 52 min
Chapter 8. Higher-Order DifferentiationFirst derivatives describe local rate of change. Second derivatives describe how that rate of change itself changes. In optimization, this is curvature. In dynamics, it is...
9 pages · 58 min
Chapter 9. Differentiation of Control FlowA conditional is a program construct that chooses one computation among several possible computations. In ordinary code, this is written as if, else, switch, case, pattern...
8 pages · 55 min
Chapter 10. Matrix and Tensor DifferentiationMatrix calculus is the notation and rule system used to differentiate functions whose inputs, outputs, or intermediate values are vectors, matrices, or tensors. Automatic...
9 pages · 73 min
Chapter 11. Compiler and Runtime DesignSource transformation is an implementation strategy for automatic differentiation in which a program that computes a function is rewritten into another program that computes...
10 pages · 84 min
Chapter 12. AD in Modern Programming LanguagesLisp is one of the natural homes of automatic differentiation. It treats programs as data, has a simple expression syntax, and supports macro systems that can transform code...
10 pages · 73 min
Chapter 13. Optimization and Machine LearningGradient descent is the basic optimization procedure behind much of modern machine learning. It is simple enough to state in one line, but rich enough to expose many of the...
10 pages · 71 min
Chapter 14. Scientific Computing ApplicationsDifferential equations are one of the main reasons automatic differentiation matters in scientific computing. Many scientific models are not written as closed-form functions....
9 pages · 65 min
Chapter 15. Differentiable Systems ArchitectureAn end-to-end differentiable pipeline is a system whose final objective can send derivative information backward through every trainable or tunable stage of computation....
9 pages · 58 min
Chapter 16. Sparse and Structured DifferentiationSparse and structured differentiation studies how to compute derivatives without materializing dense derivative objects. Many real systems have enormous Jacobians and...
1 pages · 5 min
Chapter 17. Numerical and Systems ConcernsAutomatic differentiation computes derivatives by executing arithmetic. On a real machine, arithmetic uses finite precision. This means AD gives the derivative of the...
9 pages · 66 min
Chapter 18. Advanced TopicsMany programs do not compute their output by applying a fixed sequence of explicit operations. Instead, they define the output as the solution of another problem.
10 pages · 74 min
Chapter 19. Theory and FoundationsAutomatic differentiation is often described by a simple rule:
9 pages · 62 min
Chapter 20. Building an AD EngineA minimal forward mode automatic differentiation engine has one job: evaluate a program while carrying both a value and its derivative. The engine does not build a graph. It...
10 pages · 67 min
Chapter 21. Major AD SystemsADIFOR, short for Automatic Differentiation of Fortran, is one of the classical source-transformation systems for automatic differentiation. It was designed for numerical...
10 pages · 63 min
Chapter 22. Open ProblemsAutomatic differentiation works naturally on pure mathematical functions:
1 pages · 7 min
AppendixADIFOR, short for Automatic Differentiation of Fortran, is one of the classical source-transformation systems for automatic differentiation. It was designed for numerical...
10 pages · 63 min