Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[84] A Loss Curvature Perspective on Training Instability in Deep Learning #113

Open
dhkim0225 opened this issue Mar 22, 2022 · 0 comments
Labels

Comments

@dhkim0225
Copy link
Owner

dhkim0225 commented Mar 22, 2022

paper

maximum eigenvalue of the loss Hessian == λ_1 이라 놓자.
마찬가지로, k 개의 loss Hessian 이 있다고 할 때,
minimum eigenvalue of the loss Hessian == λ_k

λ_1 < 2 / lr 상황이어야지 네트워크 학습이 안정적이라는 여러 논문들이 있어 왔다.
이 논문에서는 해당 논문들의 내용을 실질적으로 medium scale 의 실험들에서 확인해 본다.
[+] warmup 등이 어떤 영향을 미치는지 살펴본다.
[+] loss curvature 는 그냥 training loss 곡선의 곡률이다. 학습 초기에는 최대한 덜 움직이게 하는게 곡선의 곡률을 낮추는 방법이다. curvature 가 높다고 좋은 게 아니더라.

Contributions

  1. SGD+momentum 은 λ_1 < 2 / lr 일 때, stable 하다.
  2. normalization이 없는 아키텍처에 대한 몇 가지 initialize 방법은 주로 훈련 초기에 curvature를 줄여 더 큰 학습률로 훈련을 가능하게 한다.
  3. learning rate warmup 이 gradually λ_1 값을 줄여준다.
  4. large loss curvature 는 실제 성능이 구릴 수 있다.

λ_1 < 2 / lr

진짜?? 이게 진짜 적용되는거야??
하며, 저자들이 여러 실험들을 돌려봤다.
빨간 선이 λ_1 < 2 / lr 기준들이고, 대부분 이 기준을 넘어가면, 최종적으로는 네트워크 학습이 터졌다.

image

재밌는 점은, 학습이 진행되는 중간에 λ_1 값을 찍어보면 하나같이 λ_1 < 2 / lr 선에 걸려 있다는 점이다
또한, 원래는 터졌어야 할 것 같은 실험들도 warmup을 하고 학습 중간에 eigenvalue 를 찍어보니, 빨간 직선 아래로 내려온다는 점이다.

좀 더 살펴보자
image

A: non-BN variant. 3step 만에 터진다.
B: (A) 와 같은 세팅이지만, warmup을 썼다. 훨씬 안정된다.
C: MetaInit 은 알아서 초반에 hessian 값을 작게 가져간다.
D: 100 step 이전에 터지는 예제.
E: progressive sharpening
F: warmup 은 진짜 안좋은 init 까지 커버쳐주더라.

image

warmup이 참 중요한 역할을 한다는 것...!

image
아 ㅋㅋ warmup 많이 할 수록 안정적이라구

image
clipping 도 꽤나 좋은 방법이다.

최종성능에서도 warmup 은 꿀리지 않았다.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant