ArticleslgStudy

mathematics

Hessian automatic differentiation

Hessian automatic differentiation is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Hessian automatic differentiation rather than just read about it. In short: In applied mathematics, Hessian automatic differentiation are techniques based on automatic differentiation (AD) that calculate the second derivative of an n {\displaystyle n} -dimensional function, known as the Hessian matrix. When examining a function in a neighborhood of a point, one can discard many complicated global aspects of the function and accurately approximate it with simpler functions.

Hessian automatic differentiation — main illustration
Hessian automatic differentiation — illustration

Key takeaways

  • Hessian automatic differentiation belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Hessian automatic differentiation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Hessian automatic differentiation from memory before moving on to harder problems.

Reference excerpt

In applied mathematics, Hessian automatic differentiation are techniques based on automatic differentiation (AD) that calculate the second derivative of an n {\displaystyle n} -dimensional function, known as the Hessian matrix. When examining a function in a neighborhood of a point, one can discard many complicated global aspects of the function and accurately approximate it with simpler functions. The quadratic approximation is the best-fitting quadratic in the neighborhood of a point, and is frequently used in engineering and science. To calculate the quadratic approximation, one must first calculate its gradient and Hessian matrix. Let f : R n → R {\displaystyle f:\mathbb {R} ^{n}\rightarrow \mathbb {R} } , for each x ∈ R n {\displaystyle x\in \mathbb {R} ^{n}} the Hessian matrix H ( x ) ∈ R n × n {\displaystyle H(x)\in \mathbb {R} ^{n\times n}} is the second order derivative and is a symmetric matrix.

Reverse Hessian-vector products For a given u ∈ R n {\displaystyle u\in \mathbb {R} ^{n}} , this method efficiently calculates the Hessian-vector product H ( x ) u {\displaystyle H(x)u} . Thus can be used to calculate the entire Hessian by calculating H ( x ) e i {\displaystyle H(x)e_{i}} , for i = 1 , … , n {\displaystyle i=1,\ldots ,n} . The method works by first using forward AD to perform f ( x ) → u T ∇ f ( x ) {\displaystyle f(x)\rightarrow u^{T}\nabla f(x)} , subsequently the method then calculates the gradient of u T ∇ f ( x ) {\displaystyle u^{T}\nabla f(x)} using Reverse AD to yield ∇ ( u ⋅ ∇ f ( x ) ) = u T H ( x ) = ( H ( x ) u ) T {\displaystyle \nabla \left(u\cdot \nabla f(x)\right)=u^{T}H(x)=(H(x)u)^{T}} . Both of these two steps come at a time cost proportional to evaluating the function, thus the entire Hessian can be evaluated at a cost proportional to n evaluations of the function.

Reverse Hessian: Edge_Pushing An algorithm that calculates the entire Hessian with one forward and one reverse sweep of the computational graph is Edge_Pushing. Edge_Pushing is the result of applying the reverse gradient to the computational graph of the gradient. Naturally, this graph has n output nodes, thus in a sense one has to apply the reverse gradient method to each outgoing node. Edge_Pushing does this by taking into account overlapping calculations.

The algorithm's input is the computational graph of the function. After a preceding forward sweep where all intermediate values in the computational graph are calculated, the algorithm initiates a reverse sweep of the graph. Upon encountering a node that has a corresponding nonlinear elemental function, a new nonlinear edge is created between the node's predecessors indicating there is nonlinear interaction between them. See the example figure on the right. Appended to this nonlinear edge is an edge weight that is the second-order partial derivative of the nonlinear node in relation to its predecessors. This nonlinear edge is subsequently pushed down to further predecessors in such a way that when it reaches the independent nodes, its edge weight is the second-order partial derivative of the two independent nodes it connects.

Graph colouring techniques for Hessians The graph colouring techniques explore sparsity patterns of the Hessian matrix and cheap Hessian vector products to obtain the entire matrix. Thus these techniques are suited for large, sparse matrices. The general strategy of any such colouring technique is as follows.

Obtain the global sparsity pattern of H {\displaystyle H}

Apply a graph colouring algorithm that allows us to compact the sparsity structure. For each desired point x ∈ R n {\displaystyle x\in \mathbb {R} ^{n}} calculate numeric entries of the compact matrix. Recover the Hessian matrix from the compact matrix. Steps one and two need only be carried out once, and tend to be costly. When one wants to calculate the Hessian at numerous points (such as in an optimization routine), steps 3 and 4 are repeated.

As an example, the figure on the left shows the sparsity pattern of the Hessian matrix where the columns have been appropriately coloured in such a way to allow columns of the same colour to be merged without incurring in a collision between elements. There are a number of colouring techniques, each with a specific recovery technique. For a comprehensive survey, see. There have been successful numerical results of such methods.

References

Illustrations

Hessian automatic differentiation: Coloured Sparsity pattern of the Hessian Matrix
Coloured Sparsity pattern of the Hessian Matrix
Hessian automatic differentiation: The compact Hessian matrix
The compact Hessian matrix

Worked examples

Example 1 — a first encounter with Hessian automatic differentiation

Start with the simplest possible case. Write down what Hessian automatic differentiation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Hessian automatic differentiation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Hessian automatic differentiation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Hessian automatic differentiation

In research
Hessian automatic differentiation appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Hessian automatic differentiation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Hessian automatic differentiation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Differential calculus, Matrices (mathematics), so understanding it makes those chapters shorter.
In everyday life
Look for Hessian automatic differentiation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Hessian automatic differentiation” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Hessian automatic differentiation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Hessian automatic differentiation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Hessian automatic differentiation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Hessian automatic differentiation in simple terms?

In applied mathematics, Hessian automatic differentiation are techniques based on automatic differentiation (AD) that calculate the second derivative of an n {\displaystyle n} -dimensional function, known as the Hessian matrix. When examining a function in a neighborhood of a point, one can discard…

Why does Hessian automatic differentiation matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Hessian automatic differentiation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Hessian automatic differentiation.

Tags

  • Differential calculus
  • Matrices (mathematics)

Keep exploring