Day14-Machine Learning : Self-attention

因为之後要用到,今天就简单阅读了这个,

投影片和内容都是来自台大李弘毅教授的youtube
https://www.youtube.com/watch?v=gmsMY5kc-zw&ab_channel=Hung-yiLee

  • Network的input: vector or a set of vector
    output: 1.每个vector has a label(eg.sequence labeling)
    2.整个sequence has a label
    3.model自己决定输出labels的数量(eg.seq2seq)

先介绍output为每个vector皆有label- Sequence Labeling

https://ithelp.ithome.com.tw/upload/images/20210929/20140843luSKXumr35.png
给Fully-connected network整个window的资料
但因window没办法cover整个sequence
所以如要选取整个,使用self-attention

Self-attention

https://ithelp.ithome.com.tw/upload/images/20210929/20140843EwcTBakDPs.png
Self-attention会吃一整个sequence 的资讯,输入几个vector就输出几个

https://ithelp.ithome.com.tw/upload/images/20210929/201408430Z6NeCyISa.png
Input:一串vector
Output:考虑了整个input sequence才产生的
B1到b4是同时被计算出来的

https://ithelp.ithome.com.tw/upload/images/20210929/201408432bnpZvImGf.png
?:a1和其他input的关联度,also called Attention score

https://ithelp.ithome.com.tw/upload/images/20210929/20140843bimlnauDAP.png
https://ithelp.ithome.com.tw/upload/images/20210929/201408431xMnWMVRxa.png
https://ithelp.ithome.com.tw/upload/images/20210929/20140843Bx084UZS4l.png
https://ithelp.ithome.com.tw/upload/images/20210929/20140843S533StlAJG.png

https://ithelp.ithome.com.tw/upload/images/20210929/20140843epxHpzvPEJ.png
Truncated self-attention:不看一整句话,只看一小个范围就好(人设定范围大小)(ex:只看前後),加快运算的速度

Self-attention is the complex version of CNN.
Cuz CNN only attends in a receptive field(范围由机器network 决定的)


<<:  第 14 集:Bootstrap 客制化 Sass 原始码架构

>>:  [day14]Vue.js 网站基本建置

近似最短路径 (2)

11.2 距离不超过 3 倍的 Baswana-Sen Spanner 如果我们把近似最短距离的要求...

[Day29]领费币+布署链上

hi!今天要教好几个领免费币的方法!相信大家有看前面几天的内容一定会知道在每次进行交易时,都会需要...

[Day 13] 重新思考之後的内容

由於最近状况比较不好,事情比较多;所以今天可能就会开天窗这样 ,感觉这几天学得比较漫无目的,就会想找...

我想用 AJAX,但是...

现在使用者对网页应用程序的要求越来越高,又要好看又要反应快。常见的做法是使用 AJAX 提升页面反应...

Day 3 - Rancher 架构与安装方式介绍

本文将於赛後同步刊登於笔者部落格 有兴趣学习更多 Kubernetes/DevOps/Linux 相...