ทำความเข้าใจการปรับแต่งโมเดล

Introduction to Deep Learning in Python

Dan Becker

Data Scientist and contributor to Keras and TensorFlow libraries

ทำไมการ optimization จึงยาก

  • ปรับแต่งพารามิเตอร์นับพันตัวพร้อมกัน ซึ่งมีความสัมพันธ์ที่ซับซ้อน
  • การอัปเดตอาจไม่ทำให้โมเดลดีขึ้นอย่างมีนัยสำคัญ
  • การอัปเดตเล็กเกินไป (learning rate ต่ำ) หรือใหญ่เกินไป (learning rate สูง)
Introduction to Deep Learning in Python

Stochastic gradient descent

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)
Introduction to Deep Learning in Python

ปัญหา dying neuron

ch4_1.012.png

Introduction to Deep Learning in Python

Vanishing gradients

ch4_1.014.png

Introduction to Deep Learning in Python

Vanishing gradients

  • เกิดขึ้นเมื่อหลาย layer มีค่าความชันต่ำมาก (เช่น อยู่บนส่วนที่ราบของกราฟ tanh)
  • ในเครือข่ายที่ลึก การอัปเดตใน backprop จะใกล้เคียง 0
Introduction to Deep Learning in Python

มาฝึกกันเถอะ!

Introduction to Deep Learning in Python

Preparing Video For Download...