Model families ๐พ

Model architectures ๐

Metrics ๐

Solvers / Optimizers ๐งฎ

Training parameters

Augmentations

Deployment

Weight Decay

Preventing overfitting by regularising the weights

The weight decay hyperparameter controls the trade-off between having a powerful model and overfitting the model.

Typically, the parameter for weight decay is set on a logarithmic scale between 0 and 0.1 (0.1, 0.01, 0.001, ...). The higher the value, the less likely your model will overfit. However, if set too high, your model might not be powerful enough.

Intuition

Generally speaking, we want to make sure that our model is complex enough to map the relationship between input and output. In neural networks, this effect can be achieved by choosing weights that are far away from each other.

However, at the same time, the model shouldn't be too complex so that it doesn't overfit and doesn't generalize anymore.

Adding weight decay proposes a solution to overfitting your model by adding a term to the loss function for the distance between weights, typically in the form of an L2 normalization. This causes the optimizer to minimize not only the loss but also the distance between the weights. The loss function becomes:

But be careful; adding too much weight decay might cause your model to underfit.

Further resources

โ

Last modified 1yr ago

Copy link