当前位置:网站首页>Remplacer l'auto - attention par MLP
Remplacer l'auto - attention par MLP
2022-07-02 07:51:00 【Mezereonxp】
Catalogue des articles
AvecMLPRemplacerSelf-Attention
Un travail de Tsinghua présenté ici “Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks”
Remplacer par deux couches linéairesSelf-AttentionMécanismes,Enfin, l'amélioration de la vitesse tout en maintenant la précision.
Ce travail est surprenant,On peut utiliserMLPRemplacerAttentionMécanismes,Cela nous amène à reconsidérerAttentionLa nature de l'amélioration des performances.
TransformerDansSelf-AttentionMécanismes
Tout d'abord,,Comme le montre la figure ci - dessous:
Nous donnons les résultats de sa formalisation :
A = softmax ( Q K T d k ) F o u t = A V A = \text{softmax}(\frac{QK^T}{\sqrt{d_k}})\\ F_{out} = AV A=softmax(dkQKT)Fout=AV
Parmi eux, Q , K ∈ R N × d ′ Q,K \in \mathbb{R}^{N\times d'} Q,K∈RN×d′ En même temps V ∈ R N × d V\in \mathbb{R}^{N\times d} V∈RN×d
Ici., Nous donnons une version simplifiée ,Comme le montre la figure ci - dessous:
Ce qui signifie que Q , K , V Q,K,V Q,K,V Toutes les caractéristiques d'entrée F F F Remplacer, Il prend la forme de :
A = softmax ( F F T ) F o u t = A F A = \text{softmax}(FF^T)\\ F_{out} = AF A=softmax(FFT)Fout=AF
Et pourtant, La complexité du calcul ici est O ( d N 2 ) O(dN^2) O(dN2),C'estAttention Un inconvénient majeur du mécanisme .
Attention extérieure (External Attention)
Comme le montre la figure ci - dessous:
Deux matrices ont été introduites M k ∈ R S × d M_k\in \mathbb{R}^{S\times d} Mk∈RS×d Et $M_v \in\mathbb{R}^{S\times d} $, Remplacer l'original K , V K,V K,V
La formalisation est donnée ici directement :
A = Norm ( F M k T ) F o u t = A M v A = \text{Norm}(FM_k^T)\\ F_{out} = AM_v A=Norm(FMkT)Fout=AMv
Ce Design, Réduire la complexité à O ( d S N ) O(dSN) O(dSN), Le travail a révélé ,Quand S ≪ N S\ll N S≪N Quand, Toujours capable de maintenir une précision suffisante .
Dont: Norm ( ⋅ ) \text{Norm}(\cdot) Norm(⋅) L'opération consiste à faire d'abord la colonne Softmax, Puis la ligne est normalisée .
Analyse expérimentale
Tout d'abord,,ArticleTransformerDansAttentionLe mécanisme est remplacé par, Puis testez - les sur toutes sortes de tâches ,Y compris::
- Classification des images
- Segmentation sémantique
- Génération d'images
- Classification des nuages ponctuels
- Point Cloud Split
Seuls quelques résultats sont présentés ici , Décrivez brièvement la perte de précision après le remplacement .
Classification des images
Segmentation sémantique
Génération d'images
Je vois., Dans différentes missions , En gros, il n'y a pas de perte de précision .
边栏推荐
- Two dimensional array de duplication in PHP
- Huawei machine test questions
- Open3D学习笔记一【初窥门径,文件读取】
- Memory model of program
- 【Sparse-to-Dense】《Sparse-to-Dense:Depth Prediction from Sparse Depth Samples and a Single Image》
- 【Paper Reading】
- The difference and understanding between generative model and discriminant model
- 【MobileNet V3】《Searching for MobileNetV3》
- Yolov3 trains its own data set (mmdetection)
- Calculate the difference in days, months, and years between two dates in PHP
猜你喜欢
Using compose to realize visible scrollbar
基于pytorch的YOLOv5单张图片检测实现
【MobileNet V3】《Searching for MobileNetV3》
《Handwritten Mathematical Expression Recognition with Bidirectionally Trained Transformer》论文翻译
MoCO ——Momentum Contrast for Unsupervised Visual Representation Learning
Faster-ILOD、maskrcnn_ Benchmark installation process and problems encountered
Record of problems in the construction process of IOD and detectron2
【深度学习系列(八)】:Transoform原理及实战之原理篇
【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》
ABM thesis translation
随机推荐
聊天中文语料库对比(附上各资源链接)
PointNet原理证明与理解
【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》
【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》
[CVPR‘22 Oral2] TAN: Temporal Alignment Networks for Long-term Video
[in depth learning series (8)]: principles of transform and actual combat
《Handwritten Mathematical Expression Recognition with Bidirectionally Trained Transformer》论文翻译
Common machine learning related evaluation indicators
What if the laptop can't search the wireless network signal
点云数据理解(PointNet实现第3步)
【Mixup】《Mixup:Beyond Empirical Risk Minimization》
Implementation of yolov5 single image detection based on pytorch
【学习笔记】反向误差传播之数值微分
C#与MySQL数据库连接
Machine learning theory learning: perceptron
【BiSeNet】《BiSeNet:Bilateral Segmentation Network for Real-time Semantic Segmentation》
【雙目視覺】雙目矯正
【深度学习系列(八)】:Transoform原理及实战之原理篇
Open failed: enoent (no such file or directory) / (operation not permitted)
Mmdetection installation problem