Eniyileyiciler

Python ile TensorFlow’a Giriş

Isaiah Hull

Visiting Associate Professor of Finance, BI Norwegian Business School

Bir minimum nasıl bulunur

Görsel Büyük Kanyon'u gösteriyor.

1 Kaynak: ABD Ulusal Park Servisi
Python ile TensorFlow’a Giriş

Bir minimum nasıl bulunur

Görsel Büyük Kanyon'u gösteriyor.

1 Kaynak: ABD Ulusal Park Servisi
Python ile TensorFlow’a Giriş

Bir minimum nasıl bulunur

Görsel Büyük Kanyon'u gösteriyor.

1 Kaynak: ABD Ulusal Park Servisi
Python ile TensorFlow’a Giriş

Şekil, basit bir problem için SGD, RMSprop ve Adam eniyileyicilerinin öğrenme yollarını gösteriyor.

Python ile TensorFlow’a Giriş

Gradyan inişi eniyileyicisi

  • Stokastik gradyan inişi (SGD) eniyileyici

    • tf.keras.optimizers.SGD()
    • learning_rate
  • Basit ve yorumlaması kolay

Python ile TensorFlow’a Giriş

RMSprop eniyileyicisi

  • Kök ortalama karesel (RMS) yayılım eniyileyicisi

    • Her özelliğe farklı öğrenme hızı uygular
    • tf.keras.optimizers.RMSprop()
    • learning_rate
    • momentum
    • decay
  • Momentumun hem birikmesine hem azalmasına izin verir

Python ile TensorFlow’a Giriş

Adam eniyileyicisi

  • Uyarlamalı moment (Adam) eniyileyici

    • tf.keras.optimizers.Adam()
    • learning_rate
    • beta1
  • Varsayılan değerlerle genelde iyi performans gösterir

Python ile TensorFlow’a Giriş

Tam bir örnek

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 ile TensorFlow’a Giriş

Haydi pratik yapalım!

Python ile TensorFlow’a Giriş

Preparing Video For Download...