인공지능/이론 정리

[Deep learning book] 5.2.2 Regularization

고등어찌짐 2022. 9. 5. 23:30

5.2.2 Regularization

  • Regularization
    - reduce its generalization error but not its training error

  • weight decay
    - minimize a sumJ(w) comprising both the mean squared error on the training and a criterion thatexpresses a preference for the weights to have smaller squaredL2norm
    - λ is a value chosen ahead of time that controls the strength of our preferencefor smaller weights
    -  model’s tendency to overfit or underfit via weight decay, we can train a high-degree polynomial regression model with different values of λ

  • regularizer
    - we can regularize a model that learns a function f (x;θ) byadding a penalty called a regularizer to the cost function
    - weight decay, the regularizer is Ω(w)=wTw

5.2.2 Regularization

  • Regularization
    - 오버피팅 해결 => 용량 제어가 필요 
    - 방법 (1) 학습 데이터셋을 늘리는 것 
    - 방법 (2) 함수의 복잡도를 조정 = 정규화 
    - 학습된 모델의 복잡도를 줄이기 위해 loss function 에 weight 가 커질 경우 패널티를 줌 
    - generalization error 를 줄이는 방법 ( training error 줄이는 것 아님 ) 

  • weight decay ( 가중치 감쇠 ) 
    - 함수 복잡도를 조절할 수 있는 방법 중 하나
    - 여러 함수들 중 f = 0 이 가장 간단항 형태이므로, 0 과 얼마나 가까운지를 이용해 측정
    - 가중치 벡터가 작다 = 함수가 간단하다 

    - J(w) 를 최소화해서 함수 복잡도를 조절
    - λ 는 weight 의 강도를 조절함
    - λ = 0 이라면 원래의 손실함수 형태로 돌아가고, λ > 이면 w 값이 너무 커지지 않도록 조절해줌 
    - λ 값을 조정해서 overfitting, underfitting 을 해결 
    - weight decay 의 regularizer : Ω(w)=wTw