Skip to content
Lambdian

Regularisation

Adding a penalty for model complexity, usually large weights, to reduce overfitting.

Regularisation changes the training objective from "fit the data" to "fit the data without extreme parameters". The most common forms add a penalty on the weights:

J(w)=loss+λ∥w∥22(ridge / L2)J(w)=loss+λ∥w∥1(lasso / L1)J(\mathbf{w}) = \text{loss} + \lambda\lVert\mathbf{w}\rVert_2^2 \quad\text{(ridge / L2)}\qquad J(\mathbf{w}) = \text{loss} + \lambda\lVert\mathbf{w}\rVert_1 \quad\text{(lasso / L1)}

L2 shrinks all weights smoothly; L1 pushes some exactly to zero, selecting features. The strength λ\lambda is chosen by cross-validation. Neural networks also use dropout, weight decay, early stopping and data augmentation as regularisers.

See it in action