выпускать: 2026/10/02 17:40 читать: 0
Оригинальный автор:Mehdi Hosseini Moghadam
Первоисточник:https://www.youtube.com/embed/Gi8u8ET7ghY
Attention, multi-head attention and the full Transformer, explained from zero and coded from scratch in PyTorch, with every step worked by hand on a tiny example and every tensor shape on screen. We start with why recurrent networks struggled, turn words into vectors, and build attention one step at a time: dot products, softmax, queries, keys and values, why we divide by the square root of d_k, causal and padding masks. Then multi-head attention: splitting 512 dimensions into 8 heads of 64, the shapes after every line of code, and a check against PyTorch's own nn.MultiheadAttention. Next the rest of the Transformer: sinusoidal positional encodings, residual connections and LayerNorm, the feed-forward block, encoder and decoder layers, cross-attention and the full architecture. Finally we train it live on a GPU, decode step by step and look at the attention maps it learned. Key takeaway: attention lets every token look at every other token in one step, and that is the whole Transformer. Timeline 0:00 - 3:55 Why attention 3:55 - 7:35 Words become vectors 7:35 - 16:07 Attention, step by step 16:07 - 19:12 Masks 19:12 - 26:50 Multi-head attention 26:50 - 32:48 Positions, norms and feed-forward 32:48 - 38:25 The full Transformer 38:25 - 44:30 Training and inference 44:30 - 46:50 Summary Subscribe for more: https://www.youtube.com/@mehdihosseinimoghadam GitHub: https://github.com/mehdihosseinimoghadam LinkedIn: https://linkedin.com/in/mehdi-hosseini-moghadam-384912198 #Transformer #Attention #SelfAttention #MultiHeadAttention #PyTorch #DeepLearning #MachineLearning #LLM #NLP #AI #Python #AttentionIsAllYouNeed #ArtificialIntelligence
阅文漫画
2026-10-02 19:47
凌雲爽劇社TopDrama
2026-10-02 19:46
桔子好剧
2026-10-02 19:46
로맨스Drama
2026-10-02 19:46
星河劇舍
2026-10-02 19:46
逐鹿短剧
2026-10-02 19:36
E_SHUVO
2026-10-02 19:16
Stock Inspired Live
2026-10-02 19:16
CryptoTuts
2026-10-02 19:16
Выберите валюту
US Dollar
USD
Chinese Yuan
CNY
Japanese Yen
JPY
South Korean Won
KRW
New Taiwan Dollar
TWD
Canadian Dollar
CAD
Euro
EUR
Pound Sterling
GBP
Danish Krone
DKK
Hong Kong Dollar
HKD
Australian Dollar
AUD
Brazilian Real
BRL
Swiss Franc
CHF
Chilean Peso
CLP
Czech Koruna KČ
CZK
Singapore Dollar
SGD
Indian Rupee
INR
Saudi Riyal
SAR
Vietnamese Dong
VND
Thai Baht
THB
Выберите валюту
US Dollar
USD-$
Chinese Yuan
CNY-¥
Japanese Yen
JPY-¥
South Korean Won
KRW -₩
New Taiwan Dollar
TWD-NT$
Canadian Dollar
CAD-$
Euro
EUR - €
Pound Sterling
GBP-£
Danish Krone
DKK-KR
Hong Kong Dollar
HKD- $
Australian Dollar
AUD-$
Brazilian Real
BRL -R$
Swiss Franc
CHF -FR
Chilean Peso
CLP-$
Czech Koruna KČ
CZK -KČ
Singapore Dollar
SGD-S$
Indian Rupee
INR -₹
Saudi Riyal
SAR -SAR
Vietnamese Dong
VND-₫
Thai Baht
THB -฿