Penalizing Gradient Norm for Efficiently Improving Generalization in Deep Learning

Yang Zhao, Hao Zhang, Xiuyuan Hu
2/8/2022
cs.LGcs.AI

Official code: zhaoyang-0204/gnp (42 stars, Python, Apache-2.0, last commit 2024-06-17).

Abstract

How to train deep neural networks (DNNs) to generalize well is a central concern in deep learning, especially for severely overparameterized networks nowadays. In this paper, we propose an effective method to improve the model generalization by additionally penalizing the gradient norm of loss function during optimization.

Show full abstract

We demonstrate that confining the gradient norm of loss function could help lead the optimizers towards finding flat minima. We leverage the first-order approximation to efficiently implement the corresponding gradient to fit well in the gradient descent framework. In our experiments, we confirm that when using our methods, generalization performance of various models could be improved on different datasets. Also, we show that the recent sharpness-aware minimization method (Foret et al., 2021) is a special, but not the best, case of our method, where the best case of our method could give new state-of-art performance on these tasks. Code is available at {https://github.com/zhaoyang-0204/gnp}.

View on arXivView PDF

Code Implementations(1)

zhaoyang-0204/gnpOfficial100%
Apache-2.0

gradient norm penalty

424Python, ShellJun 15, 20222 years agoApache-2.0

Similar Papers

Cite this paper

@article{zhao2022penalizing,
  title  = {Penalizing Gradient Norm for Efficiently Improving Generalization in Deep Learning},
  author = {Yang Zhao and Hao Zhang and Xiuyuan Hu},
  year   = {2022},
  eprint = {2202.03599},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2202.03599}
}

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/2202.03599.svg)](https://codeofpaper.com/paper/2202.03599)

Discussion