The Living Thing / Notebooks :

Generalisation in neural networks

Generalisation for street fighters

Q: Which of these tricks bring new insight that I can apply outside of deep settings?

General framing

How do we get generalisation from neural networks?

Here’s one interesting perspective. Is it correct? (ZBHR17)

[…] Explicit regularization may improve generalization performance, but is neither necessary nor by itself sufficient for controlling generalization error. […]Appealing to linear models, we analyze how SGD acts as an implicit regularizer.

Early stopping

e.g. Prec12. Don’t keep training your model. The regularisation method that actually makes learning go faster, because you don’t bother to do as much of it.

Noise layers


A very popular of noise layer, multiplicative. Interesting because it has an interesting rationale in terms of model averaging and as a kind of implicit probabilistic learning.

Input perturbation

Parametric noise layer. If you are hip you will take this further and do it by…

Adversarial training

See adversarial learning.

Regularisation penalties

L_1, L_2, dropout… Seems to be applied to weights, but rarely to actual neurons.

See Compressing neural networks for that latter use.

This is attractive but has an expensive hyperparameter to choose.

Reversible learning

An elegant autodiff hack, where you find the gradient of the model (loss?) with respect to the model hyperparameters. Usually regularisation hyperparameters, although they don’t require that. Proposed by Bengio, Baydin and Pearlmutter (Beng00, BaPe14) made feasible by Maclaurin et al (MaDA15). Differentiate your optimisation itself with respect to hyperparameters. Non-trivial to implement, though.

Bayesian optimisation

Choose your regularisation hyperparameters optimally even without fancy reversible learning but designing optimal experiments to find the optimum loss. See Bayesian optimisation.


Weight Normalization

Pragmatically, controlling for variability in your data can be very hard in, e.g. deep learning so you might normalise it by the batch variance. Salimans and Kingma (SaKi16) have a more satisfying approach to this.

We present weight normalization: a reparameterisation of the weight vectors in a neural network that decouples the length of those weight vectors from their direction. By reparameterizing the weights in this way we improve the conditioning of the optimization problem and we speed up convergence of stochastic gradient descent. Our reparameterisation is inspired by batch normalization but does not introduce any dependencies between the examples in a minibatch. This means that our method can also be applied successfully to recurrent models such as LSTMs and to noise-sensitive applications such as deep reinforcement learning or generative models, for which batch normalization is less well suited. Although our method is much simpler, it still provides much of the speed-up of full batch normalization. In addition, the computational overhead of our method is lower, permitting more optimization steps to be taken in the same amount of time.

They provide an open implemention for keras, Tensorflow and lasagne.