Backpropagation ในทางปฏิบัติ

Introduction to Deep Learning in Python

Dan Becker

Data Scientist and contributor to Keras and TensorFlow libraries

Backpropagation

ch2_4_v2.002.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.003.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.004.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.010.png

Introduction to Deep Learning in Python

การคำนวณความชันของน้ำหนักแต่ละตัว

  • Gradient ของน้ำหนักคือผลคูณของ:
    1. ค่าของโหนดที่ป้อนเข้าสู่น้ำหนักนั้น
    2. ความชันของฟังก์ชัน activation ของโหนดที่รับค่า
    3. ความชันของฟังก์ชัน loss เทียบกับโหนดผลลัพธ์
Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.016.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.017.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.018.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.019.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.020.png

Introduction to Deep Learning in Python

Backpropagation

ch2_4_v2.021.png

Introduction to Deep Learning in Python

Backpropagation: สรุป

  • เริ่มต้นด้วยน้ำหนักแบบสุ่ม
  • ใช้ forward propagation เพื่อทำนายผล
  • ใช้ backward propagation คำนวณความชันของฟังก์ชัน loss เทียบกับน้ำหนักแต่ละตัว
  • คูณความชันด้วย learning rate แล้วลบออกจากน้ำหนักปัจจุบัน
  • วนซ้ำจนกว่าจะถึงจุดที่ความชันราบเรียบ
Introduction to Deep Learning in Python

Stochastic gradient descent

  • โดยทั่วไปจะคำนวณความชันจากข้อมูลเพียงส่วนหนึ่ง (เรียกว่า batch)
  • ใช้ batch ใหม่ในการคำนวณการอัปเดตครั้งถัดไป
  • เริ่มต้นใหม่เมื่อใช้ข้อมูลครบทุกรายการแล้ว
  • การผ่านข้อมูล training ครบหนึ่งรอบเรียกว่า epoch
  • การคำนวณความชันทีละ batch เรียกว่า stochastic gradient descent
Introduction to Deep Learning in Python

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

Introduction to Deep Learning in Python

Preparing Video For Download...