Views
No views yet
1- Embedding layer (vocab_size → d_model)
2- Dropout rate: 0.41- Input processing dropout: 0.3
2- Local aggregation MLP:
3 - Linear(d_model → d_model)
4 - GELU activation
5 - Dropout(0.3)
6 - Linear(d_model → d_model)
7- Gate network:
8 - Linear(2*d_model → d_model)
9 - GELU activation
10 - Linear(d_model → d_model)
11 - Sigmoid activation
12- Output dropout: 0.31- Query/Key/Value projections: Linear(d_model → d_model)
2- Scaled dot-product attention
3- Attention dropout: 0.3
4- Output dropout: 0.31- Linear projection: d_model → d_model
2- Dropout: 0.1
3- Gate network:
4 - Linear(2*d_model → d_model)
5 - GELU activation
6 - Linear(d_model → d_model)
7 - Sigmoid activation1import torch
2import torch.nn as nn1@article{legg2025swarmformer,
2 title={SwarmFormer: Local-Global Hierarchical Attention via Swarming Token Representations},
3 author={Legg, Jordan and Sturmanis, Mikus and {Takara.ai}},
4 journal={Takara.ai Research},
5 year={2025},
6 url={https://takara.ai/papers/SwarmFormer-Local-Global-Hierarchical-Attention-via-Swarming-Token-Representations.pdf}
7}