본문 바로가기
Study/Machine&Deep Learning

[ML] Overfitting and Regularization

by graygreat 2018. 6. 3.
728x90
반응형



Overfitting


- Our model is very goot with training data set (with memomrization), but not good at test dataset or in real use



model 1은 일반적인 model이지만, model2는 가지고 있는 데이터에만 적합한 model이다.


model2와 같은 것을 overfitting이라고 한다.


그러면 overfitting을 어떻게 줄일까?


- training data를 늘린다.


- features의 수를 줄인다


- Regularization(일반화)


Regularization



cost function 뒤에 term을 붙여준다.


regularization strength가 0이 되면 regularization을 쓰지 않는다.


값이 커지면 regularization을 매우 중요시 생각한다.


tensorflow로 구현하게 되면


1
l2reg = 0.001 * tf.reduce_sum(tf.square(W))



반응형

'Study > Machine&Deep Learning' 카테고리의 다른 글

[ML] MNIST  (0) 2018.06.16
[ML] Training and Test datasets  (0) 2018.06.03
[ML] Learning rate  (0) 2018.06.03
[ML] Fancy Softmax Classifier  (0) 2018.05.31
[ML] Softmax classifier  (0) 2018.05.29

댓글