Loading…
Glossary term
Techniques that discourage a model from becoming too complex, reducing overfitting.
Regularization adds a pressure that keeps a model from becoming too complex. A common form, L2 regularization, adds a penalty to the loss for large weights, nudging the model toward simpler solutions.
Other forms include dropout, early stopping and data augmentation.
L2 regularization added to the loss
l2_strength = 0.01
loss = data_loss + l2_strength * sum((w ** 2).sum() for w in weights)It is a main defense against overfitting, especially with limited data.