최적화기

Python으로 시작하는 TensorFlow

Isaiah Hull

Visiting Associate Professor of Finance, BI Norwegian Business School

최솟값 찾기 방법

그랜드 캐니언 사진입니다.

1 출처: U.S. National Park Service
Python으로 시작하는 TensorFlow

최솟값 찾기 방법

그랜드 캐니언 사진입니다.

1 출처: U.S. National Park Service
Python으로 시작하는 TensorFlow

최솟값 찾기 방법

그랜드 캐니언 사진입니다.

1 출처: U.S. National Park Service
Python으로 시작하는 TensorFlow

간단한 문제에서 SGD, RMSprop, Adam 최적화기의 학습 경로를 보여 줍니다.

Python으로 시작하는 TensorFlow

Gradient Descent 최적화기

  • 확률적 경사 하강법(SGD) 최적화기

    • tf.keras.optimizers.SGD()
    • learning_rate
  • 단순하고 해석이 용이

Python으로 시작하는 TensorFlow

RMSprop 최적화기

  • 제곱평균제곱근(RMS) 전파 최적화기

    • 각 특성에 다른 학습률 적용
    • tf.keras.optimizers.RMSprop()
    • learning_rate
    • momentum
    • decay
  • 모멘텀의 축적과 감소를 모두 허용

Python으로 시작하는 TensorFlow

Adam 최적화기

  • Adaptive Moment(Adam) 최적화기

    • tf.keras.optimizers.Adam()
    • learning_rate
    • beta1
  • 기본 하이퍼파라미터만으로도 성능 우수

Python으로 시작하는 TensorFlow

완전한 예시

import tensorflow as tf

# Define the model function
def model(bias, weights, features = borrower_features):
    product = tf.matmul(features, weights)
    return tf.keras.activations.sigmoid(product+bias)
# Compute the predicted values and loss
def loss_function(bias, weights, targets = default, features = borrower_features):
    predictions = model(bias, weights)
    return tf.keras.losses.binary_crossentropy(targets, predictions)
# Minimize the loss function with RMS propagation
opt = tf.keras.optimizers.RMSprop(learning_rate=0.01, momentum=0.9)
opt.minimize(lambda: loss_function(bias, weights), var_list=[bias, weights])
Python으로 시작하는 TensorFlow

연습해 봅시다!

Python으로 시작하는 TensorFlow

Preparing Video For Download...