โมเดล Deep Neural Network มักจะมีปัญหา Overfit เมื่อเทรนกับ Dataset ที่มีขนาดเล็ก แต่เราสามารถแก้ปัญหา Overfit โดยใช้วิธีการ Ensembles คือ สร้างหลาย ๆ โมเดลแล้วเอา Output มาเฉลี่ยกัน แต่ทำแบบนี้ทั้งสิ้นเปลืองทรัพยากร เวลา และต้องคอย Maintain หลายโมเดลอีก เราจะมีวิธีอะไรที่ดีกว่านี้ไหม

Dropout Gif Animation. Credit: https://towardsdatascience.com/preventing-deep-neural-network-from-overfitting-953458db800a
Dropout Gif Animation. Credit: https://towardsdatascience.com/preventing-deep-neural-network-from-overfitting-953458db800a

Dropout

เราสามารถใช้แค่โมเดลเดียว มาจำลองเป็นหลาย ๆ โมเดลได้ โดยการสุ่มถอดบาง Node ออก ในระหว่างการเทรน วิธีนี้เรียกว่า Dropout เป็นวิธีที่ชาญฉลาด ประหยัดทั้งเวลา และทรัพยากร และที่สำคัญเราไม่ต้อง Maintain หลาย ๆ โมเดล

Dropout ถือเป็นวิธี Regularization แบบหนึ่ง ช่วยลดการจำข้อสอบ ลด Overfit และทำให้โมเดล Deep Neural Network ทุก ๆ สถาปัตยกรรม Generalization ดีขึ้น

Test error for different architectures with and without dropout. The networks have 2 to 4 hidden layers each with 1024 to 2048 units. Credit: http://jmlr.org/papers/v15/srivastava14a.html
Test error for different architectures with and without dropout. The networks have 2 to 4 hidden layers each with 1024 to 2048 units. Credit: http://jmlr.org/papers/v15/srivastava14a.html

เรามาเริ่มกันเลย

Open In Colab

Credit

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

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.