Learning rate vs batch size:
batch size를 바꾸면 learning rate는 어떻게 바꿔야할까?
Square root scaling rule: 조금 오래된 논문 (https://arxiv.org/abs/1404.5997) 의하면 square root scaling rule을 주장하지만 "Theory suggests that when multiplying the batch size by k, one should multiply the learning rate by √ k to keep the variance in the gradient expectation constant."
Linear scaling rule: 조금 더 최신 결과에 (https://arxiv.org/abs/1706.02677) 의하면 linear scaling rule이 더 좋아 보인다 "When the minibatch size is multiplied by k, multiply the learning rate by k."
Optimizer dependent rule: SGD같은 경우 linear scaling rule, adam같은 adaptive optimzer은 square root scaling rule이 좋다는 분석이 있다 (https://arxiv.org/abs/2006.09092). 다음 stackoverflow 패이지 참고하는 것을 추천 (https://stackoverflow.com/questions/53033556/how-should-the-learning-rate-change-as-the-batch-size-ch)
SGD같은 경우 linear scaling rule이 확실히 좋은 starting point인 것 같다.
SGD vs Adam
구글링을 해보면 SGD 가 Adam같은 adaptive method보다 generalization이 잘 된다는 논문들을 많이 찾을 수 있고, 왜 이런 현상이 나타나는지 분석하는 논문들도 볼 수 있다 (https://arxiv.org/abs/2010.05627). 개인적으로도 Adam을 사용했을 때 보다 SGD로 학습했을 때 loss는 같지만 generalization이 더 잘 되는 현상을 여러번 목격한 적이 있다. 반면 attention model에는 Adam같은 adaptive method가 더 좋다고 분석하는 논문도 있다 (https://arxiv.org/abs/1912.03194).
하지만 이 논문에서는 (https://arxiv.org/abs/1910.05446) hyperparameter searching 문제라고 한다. 특히 Adam이랑 SGD+momentum같은 경우 Adam의 parameter을 잘 맞춰주면 (단 Adam에서 divergence를 막으려고 도입한 epsilon parameter도 중요함) SGD+momentum이 구현가능하다고 한다. 그런 경우 당연하겠지만 SGD+momentum은 Adam에 속하기 때문에, Adam의 parameter을 잘 튜닝하면 SGD+momentum보다 퍼포먼스가 낮을 수 없다.
ImageNet pre-training
pre-training / self-supervised training / self-distillation 관련 논문들을 찾아보다가 흥미로운 결과들을 찾았다. 당연하게도 ImageNet pre-training이 항상 도움될 것이라고 생각하지 않았는데, 이런 것에 대한 논문들이 있었다.
- Rethinking ImageNet pre-training: (https://arxiv.org/abs/1811.08883) 충분히 큰 데이터셋에 오랫동안 학습하면 (사실 당연하게도) ImageNet pre-training이 별로 도움 안된다. 특히 object detection 문제에서 (COCO dataset) \( AP_{75}\) metric 같은 경우 pre-training한 network로 학습시키면 성능이 상당히 떨어지는 것을 볼 수 있다.
- Rethinking Pre-training and Self-training: (https://arxiv.org/abs/2006.06882) 이 논문은 더 재미있다. ImageNet pre-training이 명확하게 성능 저하를 시키는 regime을 찾았다. Data augmentation을 더 강하게 하다보면 random initialized model이 결국 pre-training한 모델 성능을 능가하게 된다 (COCO dataset). 비슷한 task에 대한 pre-trained model도 성능을 저하시킬 수 있는 논문도 있다고 지적한다 (For example, Shao et al. [45] found that pre-training on the Open Images object detection dataset actually hurts COCO performance. More analysis of targeted pre-training can be found in [46].)
재미있는 것 더 찾으면 계속 업데이트할 예정...
'논문 리뷰 > others' 카테고리의 다른 글
기초 diffusion probabilistic model 이론 공부 로드맵 (1) | 2024.06.16 |
---|---|
[간단 리뷰] RepOptimizer (RepOpt-VGG) (0) | 2023.06.29 |
[간단 리뷰] RepVGG: Making VGG-style ConvNets Great Again (0) | 2023.06.18 |
[논문 리뷰] Sinkhorn Distances: Lightspeed Computation of Optimal Transport (2) | 2023.02.18 |