모델 학습에 대해
모델 학습을 시도하면서 마주한 문제들을 해결하면서 배운 것들
🤔Loss가 계속 fluctuate 한다
모델을 학습할 때 확인해야할 요소들
- optimizer
- learning rate sechduling
- model capacity (=size)
- data
여기서 (3) model capacity랑 (4) data가 overfitting인지 underfitting인지를 결정한다. 만약 모델이 데이터보다 더 크다면 underfitting 데이터보다 모델이 더 크다면 underfitting인 것이다.
Optimizer and Learning Rate
- Adam optimizer의 경우, 저절로 lr를 바꾼다는 것을 기억해야한다.
- Stimulated Annealing
Model Capacity
- 만약 모델의 loss가 충분히 낮지 않으면 model capacity가 너무 작아서, 즉, 너무 작은 모델로 학습을 시키고 있어서 그럴 수 있다 (또는 데이터의 노이즈가 너무 많아서 그런 것일 수도 있다).
- 더 큰 모델로 학습시켜보는 것도 좋은 방법이 될 수 있다.
내가 확인한 문제의 경우 더 복잡한 모델을 사용했을 때 fluctuation이 줄었고 loss도 더 낮게 수렴했다.
Stochastic GD vs. “Regular” Gradient Descent
- Stochastic의 의미 : 확률론적
- Stochastic의 경우 배치로 나눠서 일부의 데이터로 다음 결정을 내린다면, 일반적인 gradient descent의 경우 모든 데이터를 기반으로 다음 결정을 내리는 것이다.
- 그렇기 때문에 많은 데이터로 학습을 시킬경우 SGD를 사용하는 것이다.
This iterative process continues with randomly selected training examples until the algorithm reaches a predetermined stopping point. This method is preferred when working with large datasets because it takes less time to process a single example than it does to process the entire dataset. (source)
😎직접 시도
- 사용한 모델 : PaddlePaddle의 PaddleYOLOE+ (batch size : 16)
- vibrant-wave-12 (주황색) : PP-YOLOE+_s
- usual-violet-8 (보라색) : PP-YOLOE+_m
This post is licensed under CC BY 4.0 by the author.