모델 최적화 이해하기

Python으로 시작하는 Deep Learning

Dan Becker

Data Scientist and contributor to Keras and TensorFlow libraries

왜 최적화가 어려운가

  • 복잡한 관계의 수천 개 파라미터를 동시에 최적화
  • 업데이트가 모델을 의미 있게 개선하지 않을 수 있음
  • 학습률이 낮으면 너무 작고, 높으면 너무 큰 업데이트
Python으로 시작하는 Deep Learning

확률적 경사 하강법

def get_new_model(input_shape = input_shape):
    model = Sequential()
    model.add(Dense(100, activation='relu', input_shape = input_shape))
    model.add(Dense(100, activation='relu'))
    model.add(Dense(2, activation='softmax'))
    return(model)

lr_to_test = [.000001, 0.01, 1]

# Loop over learning rates
for lr in lr_to_test:
   model = get_new_model()
   my_optimizer = SGD(lr=lr)
   model.compile(optimizer = my_optimizer, loss = 'categorical_crossentropy')
   model.fit(predictors, target)
Python으로 시작하는 Deep Learning

죽은 뉴런 문제

죽은 뉴런 문제

Python으로 시작하는 Deep Learning

기울기 소실

기울기 소실

Python으로 시작하는 Deep Learning

기울기 소실

  • 여러 층의 기울기가 매우 작을 때 발생(예: tanh 평평한 구간)
  • 심층 네트워크에서는 역전파 업데이트가 거의 0에 가까움
Python으로 시작하는 Deep Learning

연습해 봅시다!

Python으로 시작하는 Deep Learning

Preparing Video For Download...