Stochastic GD : Update with the gradinet computed from a single sample(batch-size) Mini-batch GD : Update with the gradinet computed from a subset of data(batch-size) Batch GD : Update with the gradinet computed from whole data(batch-size)
Batch-size Matters
a large batch tend to converge to sharp minimizers while small-batch methods consistently converge to flat minimizers; this is due to the inherent noise in the gradient estimation.
flat minimizer의 generalization performance가 더 좋다.
-> This is why you should use MBGD(flat minimizer)
Gradient Descent
Wt+1=Wt−ηgt
η : learning-rate, gt : gradient
문제점 : step-size(lr) 적절히 설정하기 어렵다
Momentum
at+1=βat+gt → momentum이 포함된 gradient로 업데이트 Wt+1=Wt−ηat+1
β : momentum, at+1 : accumulation
intuition: 한번 gradient가 ➡방향으로 흐르면, 다음번 grad가 ⬅방향으로 다르게 흘러도, ➡방향 정보를 이어가자. → 전 grad 정보를 활용해보자.
Nesterov Accelerated Gradient(NAG)
at+1=βat+∇L(Wt−ηβat) → at로 이동한 곳에서 gradient를 구한 값으로 at+1을 구한다 Wt+1=Wt−ηat+1
∇L(Wt−ηβat) : Lookahead gradient
NAG converge가 더 빠르다.
Adagrad
adapts the learning rate, performing larger updates for infrequent and smaller updates for frequent parameters
Wt+1=Wt−Gt+ϵηGt
ϵ : for numerical stability (division by 0 처리)
Gt : sum of gradient squares (t까지의 gradient 변화 저장)
변화 적은 parameter 변화 ⬆, 변화 많은 parameter 변화 ⬇
문제점 : monotonically decreasing = Gt가 계속 커져서 무한대로 가면 update가 되지 않는다; 뒤로 가면 갈수록 학습 멈춤 현상이 생김
Adadelta
extends Adagrad to reduce its monotonically decreasing the learning rate by restricting the accumulation window → Adagrad의 large Gt현상을 최대한 막겠다.
학습에 반대 되도록 규제를 건다. → 학습 방해가 목적
-> test(real) data prediction에도 이 방법론이 잘 동작할 수 있게 만들어 준다.(but 보장 불가)
-> validation dataset distribution ≠ test dataset distribution이기 때문
Early Stopping
we need additional validation data to do early stopping
-> validation data : train에 활용되지 않는 dataset
cost(error)가 커지는 시점에 stop한다.
Parameter Norm Penalty (Weight Decay)
adds smoothness to the function space → 부드러운 함수일수록 generalization performance가 올라갈 것이라 가정