ใน ep ที่แล้วเราใช้ Naive Bayes และ Logistic Regression ที่เป็นอัลกอริทึมที่เป็นที่นิยมก่อนยุค Deep Learning

แต่ใน ep นี้เราจะเปลี่ยนมาใช้ Deep Neural Network แทนว่าจะมีประสิทธิภาพต่างกันอย่างไร

Universal Language Model Fine-tuning (ULMFit)

Universal Language Model Fine-tuning for Text Classification Flow Chart Diagram Credit https://arxiv.org/abs/1801.06146
Universal Language Model Fine-tuning for Text Classification Flow Chart Diagram Credit https://arxiv.org/abs/1801.06146

ในการเทรน เราจะไม่เทรนแต่ต้น โดย Initialize Weight ด้วยค่า Random หรือ Kaiming แต่เราจะใช้ Transfer Learning จาก Language Model ที่เทรนกับ Corpus ขนาดใหญ่กว่ามาก่อน เช่น WikiText-103

แล้ว Fine-Tuned Language Model นั้นเข้ากับ กับภาษา สำนวน คำศัพท์ ใน IMDB

เมื่อได้ Language Model ที่ Fine-Tuned กับภาษาของ IMDB เรียบร้อยแล้ว เราจึงนำส่วนของ Encoder มาสร้าง Sentiment Classifier ต่อ

กระบวนการนี้ เรียกว่า ULMFit หรือ Universal Language Model Fine-tuning ที่จะลดเวลาการเทรนโดยรวม และเพิ่มประสิทธิภาพการทำงานของโมเดล

AWD_LSTM Model Architecture

DropConnect sets a randomly selected subset of weights within the network to zero. Credit https://arxiv.org/abs/1906.04569
DropConnect sets a randomly selected subset of weights within the network to zero. Credit https://arxiv.org/abs/1906.04569

AWD_LSTM เป็น LSTM / Recurrent Neural Network (RNN) แบบหนึ่ง ที่มีการใช้ DropOut / DropConnect หลากหลายแบบภายในส่วนต่าง ๆ ของโมเดล อย่างชาญฉลาด จะอธิบายต่อไป

An example model layout for a single DropConnect layer. Credit http://proceedings.mlr.press/v28/wan13.html
An example model layout for a single DropConnect layer. Credit http://proceedings.mlr.press/v28/wan13.html

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

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.