หลังจากที่ใน ep ก่อน เราได้ใช้ LR_Find Callback หา Learning Rate ที่ดีที่สุดได้แล้ว แล้วเราจะนำมาใช้อย่างไร Learning Rate ถือว่าเป็นหนึ่งใน Hyperparameter ที่สำคัญที่สุดในการเทรน Machine Learning

มีแนวคิดจากหลากหลาย Paper ที่ว่า ในแต่ละ State ของการเทรน Deep Neural Network นั้นต้องการ Hyperparameter ต่างกันไป แล้วเราจะ Schedule Hyperparameter ของเราได้อย่างไร

ทำไมต้อง Schedule Hyperparameter

gradient descent Credit: Lecture 2 | Machine Learning (Stanford) https://www.youtube.com/watch?v=5u4G23_OohI
gradient descent Credit: Lecture 2 | Machine Learning (Stanford) https://www.youtube.com/watch?v=5u4G23_OohI

การ Schedule Hyperparameter มีประโยชน์ เช่น ในกรณี Learning Rate

  • ตอนเริ่มเทรน เรายังไม่รู้ว่า Global Minima อยู่ไหน โมเดลจะไปทางไหนดี ไม่ควรรีบร้อนใช้ Learning Rate สูง จะทำให้กระโดดไปผิดทางได้
  • ช่วงท้ายของการเทรน เราก็ควรลด Learning Rate ลงเพื่อ Fine Tune ไม่ให้โมเดลกระโดดออกมาจากหลุม Global Minima
  • etc.

ดังนั้นเราควรจะ Schedule ทุก Hyperparamter เท่าที่จะทำได้

ใน ep นี้เราเริ่มต้นด้วยการ มาดูตัวอย่างการ Schedule Learning Rate ด้วย Callback กัน เริ่มต้นที่หัวข้อ 6.1 ParamScheduler

เรามาเริ่มกันเลยดีกว่า

Open In Colab

แชร์ให้เพื่อน:

Surapong Kanoktipsatharporn on FacebookSurapong Kanoktipsatharporn on LinkedinSurapong Kanoktipsatharporn on Rss
Surapong Kanoktipsatharporn
Solutions Architect at Bua Labs
The ultimate test of your knowledge is your capacity to convey it to another.

Published by Surapong Kanoktipsatharporn

The ultimate test of your knowledge is your capacity to convey it to another.