Efficient Sharpness-aware Minimization for Improved Training of Neural Networks

Jiawei Du, Hanshu Yan, Jiashi Feng, Joey Tianyi Zhou, Liangli Zhen +2 more
10/7/2021
cs.AIcs.CVcs.LG

Official code: dydjw9/Efficient_SAM (58 stars, Python, last commit 2023-02-13).

Abstract

Overparametrized Deep Neural Networks (DNNs) often achieve astounding performances, but may potentially result in severe generalization error. Recently, the relation between the sharpness of the loss landscape and the generalization error has been established by Foret et al. (2020), in which the Sharpness Aware Minimizer (SAM) was proposed to mitigate the degradation of the generalization.

Show full abstract

Unfortunately, SAM s computational cost is roughly double that of base optimizers, such as Stochastic Gradient Descent (SGD). This paper thus proposes Efficient Sharpness Aware Minimizer (ESAM), which boosts SAM s efficiency at no cost to its generalization performance. ESAM includes two novel and efficient training strategies-StochasticWeight Perturbation and Sharpness-Sensitive Data Selection. In the former, the sharpness measure is approximated by perturbing a stochastically chosen set of weights in each iteration; in the latter, the SAM loss is optimized using only a judiciously selected subset of data that is sensitive to the sharpness. We provide theoretical explanations as to why these strategies perform well. We also show, via extensive experiments on the CIFAR and ImageNet datasets, that ESAM enhances the efficiency over SAM from requiring 100% extra computations to 40% vis-a-vis base optimizers, while test accuracies are preserved or even improved.

View on arXivView PDF

Code Implementations(1)

585Python, ShellOct 6, 20213 years ago

Similar Papers

Cite this paper

@article{du2021efficient,
  title  = {Efficient Sharpness-aware Minimization for Improved Training of Neural Networks},
  author = {Jiawei Du and Hanshu Yan and Jiashi Feng and Joey Tianyi Zhou and Liangli Zhen and Rick Siow Mong Goh and Vincent Y. F. Tan},
  year   = {2021},
  eprint = {2110.03141},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2110.03141}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2110.03141.svg)](https://codeofpaper.com/paper/2110.03141)

Discussion