Switch EMA: A Free Lunch for Better Flatness and Sharpness

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Li, Siyuan, Liu, Zicheng, Tian, Juanxi, Wang, Ge, Wang, Zedong, Jin, Weiyang, Wu, Di, Tan, Cheng, Lin, Tao, Liu, Yang, Sun, Baigui, Li, Stan Z.
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866929529755271168
author Li, Siyuan
Liu, Zicheng
Tian, Juanxi
Wang, Ge
Wang, Zedong
Jin, Weiyang
Wu, Di
Tan, Cheng
Lin, Tao
Liu, Yang
Sun, Baigui
Li, Stan Z.
author_facet Li, Siyuan
Liu, Zicheng
Tian, Juanxi
Wang, Ge
Wang, Zedong
Jin, Weiyang
Wu, Di
Tan, Cheng
Lin, Tao
Liu, Yang
Sun, Baigui
Li, Stan Z.
contents Exponential Moving Average (EMA) is a widely used weight averaging (WA) regularization to learn flat optima for better generalizations without extra cost in deep neural network (DNN) optimization. Despite achieving better flatness, existing WA methods might fall into worse final performances or require extra test-time computations. This work unveils the full potential of EMA with a single line of modification, i.e., switching the EMA parameters to the original model after each epoch, dubbed as Switch EMA (SEMA). From both theoretical and empirical aspects, we demonstrate that SEMA can help DNNs to reach generalization optima that better trade-off between flatness and sharpness. To verify the effectiveness of SEMA, we conduct comparison experiments with discriminative, generative, and regression tasks on vision and language datasets, including image classification, self-supervised learning, object detection and segmentation, image generation, video prediction, attribute regression, and language modeling. Comprehensive results with popular optimizers and networks show that SEMA is a free lunch for DNN training by improving performances and boosting convergence speeds.
format Preprint
id arxiv_https___arxiv_org_abs_2402_09240
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Switch EMA: A Free Lunch for Better Flatness and Sharpness
Li, Siyuan
Liu, Zicheng
Tian, Juanxi
Wang, Ge
Wang, Zedong
Jin, Weiyang
Wu, Di
Tan, Cheng
Lin, Tao
Liu, Yang
Sun, Baigui
Li, Stan Z.
Machine Learning
Computer Vision and Pattern Recognition
Exponential Moving Average (EMA) is a widely used weight averaging (WA) regularization to learn flat optima for better generalizations without extra cost in deep neural network (DNN) optimization. Despite achieving better flatness, existing WA methods might fall into worse final performances or require extra test-time computations. This work unveils the full potential of EMA with a single line of modification, i.e., switching the EMA parameters to the original model after each epoch, dubbed as Switch EMA (SEMA). From both theoretical and empirical aspects, we demonstrate that SEMA can help DNNs to reach generalization optima that better trade-off between flatness and sharpness. To verify the effectiveness of SEMA, we conduct comparison experiments with discriminative, generative, and regression tasks on vision and language datasets, including image classification, self-supervised learning, object detection and segmentation, image generation, video prediction, attribute regression, and language modeling. Comprehensive results with popular optimizers and networks show that SEMA is a free lunch for DNN training by improving performances and boosting convergence speeds.
title Switch EMA: A Free Lunch for Better Flatness and Sharpness
topic Machine Learning
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2402.09240