Deep Learning

AdaNorm: Adaptive Gradient Norm Correction based Optimizer for CNNs

Jongmin Lim 2024. 5. 9. 21:25

Abstract

  • 최근 SGD optimizer를 기반으로 Adam, diffGrad, Radam, AdaBelief와 같은 adptive momentum이 소개됐다
    • 기존 SGD Optimizer 연구는 과거 iteration의 Gradient norm 정보를 이용하지 않아 수렴 속도와 성능이 좋지 않다
  • 따라서 본 논문에서는 Gradient norm의 adatpive한 훈련 기록 분석을 통해 각 interation에서 gradient norm을 수정하는 AdaNorm을 제안
    • 그렇게 함으로써 훈련 과정 전체에서 높고 대표적인 기울기를 유지할 수 있도록 함으로써 낮고 특이한 기울기 문제를 해결
    • 즉, 모델이 훈련하는 동안 일관된 기울기를 유지함으로써 훈련 과정이 안정화되고, 기울기가 낮거나 특이한 문제가 발생하는 것을 방지

Introduction

Stochastic Gradient Descent(SGD) Optimization 동작 순서

  1. random initialization, Xavier initialization, He initialization과 같은 방법론으로 parameters/weight를 초기화한다.
  2. 그리고 Objective function의 gradient를 이용해서 parameter를 update한다
  3. SGD approach는 learning rate에 의해서 gradient의 반대방향으로 parameter를 update한다

그러나 SGD는 다양한 문제를 겪는다.

  • Local minimum에서 gradient가 0이 되는 문제
  • Saddle region
  • 모델이 다양한 방향으로 기울기가 급격하게 변하는 상황
  • 각 파라미터에 대해 같은 step-szie를 사용

기존 연구

1) SGD with Momentum(i.e., SGDM)

2) AdaGrad

3) RMSProp

4) Adam optimizer → SGDM과 RMSProp를 결합한 개념으로 Adaptive moment를 제안

5) AMSGrad

 

Adam optimizer는 모멘텀 값이 너무 높으면 최소값에 너무 빨리 다가가게 되어 최소값을 지나쳐 버리거나, 최소값 주변에서 진동하는 문제가 발생

 

이 문제를 해결하기 위해서 diffGrad, Radam, 등등이 제안되었지만 기존의 최적화 방법은 기울기의 다양한 속성을 활용하여 학습률을 제어하려고 시도하지만,

여전히 일관성 없는 기울기로 인해 고통을 겪는다

 

본 논문에서는 전체 training iteration을 수행하는 동안 gradient norm을 수정하여 consistent를 유지한다

Contribution

  • past interations의 gradient norm의 Exponential Moving Average(EMA)를 이용하는 AdaNorm을 제안
    • training history를 기반으로 gradient norm을 rectifies하여 Consistent and informative gradient를 유지한다.
  • AdaNorm은 generic하고 기존의 어떠한 adaptive SGD optimizer와 함께 사용될 수 있다.

2. Proposed AdaNorm Optimizer

parameters $\theta$로 표된 network $f$를 고려했을 때, $t^{th}$ interation에서 gradient는 chain-rule을 사용해서 아래와 같이 계산된다

 

 

Adam optimizer는 model parameter를 update하기 위해, gradients의 Exponential Moving Average $\textbf{m}^t$를 사용했다

 

 

그러나 gradient $g_t$는 training sample에서 random batch에 평균으로 계산되므로 Past Gradient bahaviour와 일치하지 않으며 불량할 가능성이 있다.

 

따라서, 본 논문에서는 historical gradient norm을 사용하 current batch의 gradient norm을 수정하여 이 문제를 다룬다.

 

$g_{norm}= ||\textbf{g}t||_2$는 현재 gradient vector $\textbf{g}_t=(g_{t,1}, g_{t,2}, ..., g_{t,k})$라고 하면 gradient norm은 아래와 같이 계산된다

 


 

본 논문의 Gradient norm을 활용한 Gradient 수정방법

  • past gradients norm을 사용해서 $t^{th}$ iteration에서 Exponential Moving Average $e_t$를 구한다

 

여기서 $\gamma$는 historical gradient norm과 current gradient norm을 control한다

 

제안한 Gradient norm correction step은 current gradient norm이 최소한 과거 그래디언트 노름과 동일하게 되도록 하는 것을 의미

 

다시 말해, 최근의 그래디언트가 과거의 그래디언트보다 작으면 그 값이 증가하도록 보정하는 것을 의미하며, 다시 말해 이 방법은 현재의 그래디언트를 이전 그래디언트와 더 일관되게 만들어서 그래디언트의 불안정성 문제를 해결하고 성능을 향상

 

  • historical gradient norm을 사용해서 Gradient를 수정한다

  • 수정된 Gradient $s_t$를 통해 Adam 방법론을 적용한 AdamNorm Optimizer를 제안

3. Intuitive Explanation and convergence analysis

 

  • Gradient norm 수정의 중요성을 정당화하기 위해 Figure1을 제공

 


Reference

https://arxiv.org/abs/2210.06364

 

AdaNorm: Adaptive Gradient Norm Correction based Optimizer for CNNs

The stochastic gradient descent (SGD) optimizers are generally used to train the convolutional neural networks (CNNs). In recent years, several adaptive momentum based SGD optimizers have been introduced, such as Adam, diffGrad, Radam and AdaBelief. Howeve

arxiv.org