Flatness is a False Friend
arXiv:2006.09091
Abstract
Hessian based measures of flatness, such as the trace, Frobenius and spectral norms, have been argued, used and shown to relate to generalisation. In this paper we demonstrate that for feed forward neural networks under the cross entropy loss, we would expect low loss solutions with large weights to have small Hessian based measures of flatness. This implies that solutions obtained using regularisation should in principle be sharper than those without, despite generalising better. We show this to be true for logistic regression, multi-layer perceptrons, simple convolutional, pre-activated and wide residual networks on the MNIST and CIFAR- datasets. Furthermore, we show that for adaptive optimisation algorithms using iterate averaging, on the VGG- network and CIFAR- dataset, achieve superior generalisation to SGD but are sharper. This theoretical finding, along with experimental results, raises serious questions about the validity of Hessian based sharpness measures in the discussion of generalisation. We further show that the Hessian rank can be bounded by the a constant times number of neurons multiplied by the number of classes, which in practice is often a small fraction of the network parameters. This explains the curious observation that many Hessian eigenvalues are either zero or very near zero which has been reported in the literature.
9 pages, 10 figures
References in corpus (7)
- Very Deep Convolutional Networks for Large-Scale Image Recognition
- Improving Generalization Performance by Switching from Adam to SGD
- Fantastic Generalization Measures and Where to Find Them
- Towards Understanding Generalization of Deep Learning: Perspective of Loss Landscapes
- The Break-Even Point on Optimization Trajectories of Deep Neural Networks
- A Scale Invariant Flatness Measure for Deep Network Minima
- Normalized Flat Minima: Exploring Scale Invariant Definition of Flat Minima for Neural Networks using PAC-Bayesian Analysis