Calculus and gradients

H=∇2f(x)\mathbf{H} = \nabla^2 f(\mathbf{x}) Hessian matrix

The Hessian ∇²f is the matrix of second derivatives: how the gradient changes as you move.

In ML papers

For a function ff of a vector x∈Rn\mathbf{x} \in \mathbb{R}^n, the Hessian ∇2f\nabla^2 f (often H\mathbf{H}) is the n×nn \times n matrix of second partial derivatives, Hij=∂2f∂xi∂xjH_{ij} = \frac{\partial^2 f}{\partial x_i \partial x_j}. It is symmetric for smooth functions and describes the curvature of the loss surface.

A positive definite Hessian means a bowl (a local minimum); eigenvalues of mixed sign mean a saddle. Newton's method steps by −H−1∇f-\mathbf{H}^{-1} \nabla f. For a network with millions of parameters it is never formed in full; methods use Hessian-vector products or approximations instead.

Other meanings, by context

How to type it

LaTeXShows
\nabla^2 f∇2f\nabla^2 f
\nabla_\theta^2 \mathcal{L}∇θ2L\nabla_\theta^2 \mathcal{L}
\mathbf{H}H\mathbf{H}

A worked example

f=x2+3xy  ⇒  ∇2f=(2330)f = x^2 + 3xy \;\Rightarrow\; \nabla^2 f = \begin{pmatrix} 2 & 3 \\ 3 & 0 \end{pmatrix}

Differentiate twice: ∂2f/∂x2=2\partial^2 f / \partial x^2 = 2, ∂2f/∂x∂y=3\partial^2 f / \partial x \partial y = 3, ∂2f/∂y2=0\partial^2 f / \partial y^2 = 0.

Common confusions

Related

∇θL\nabla_\theta \mathcal{L}Nabla (gradient)∂L∂w\frac{\partial \mathcal{L}}{\partial w}Partial derivativeJ=∂y∂x\mathbf{J} = \frac{\partial \mathbf{y}}{\partial \mathbf{x}}Jacobian matrixW∈Rm×n\mathbf{W} \in \mathbb{R}^{m \times n}Bold uppercase (matrix)

Decode this example →