Observed since 20 Oct, 21:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Attention Free Transformer - Pytorch
Unofficial PyTorch implementation of Attention Free Transformer's layers by Zhai, et al. [abs, pdf] from Apple Inc.
You can install aft-pytorch via pip:
pip install aft-pytorch
You can import the AFT-Full or AFT-Simple layer (as described in the paper) from the package like so:
AFTFullfrom aft_pytorch import AFTFull
layer = AFTFull(
max_seqlen=20,
dim=512,
hidden_dim=64
)
# a batch of sequences with 10 timesteps of length 512 each
x = torch.rand(32, 10, 512)
y = layer(x) # [32, 10, 512]
AFTSimplefrom aft_pytorch import AFTSimple
layer = AFTSimple(
max_seqlen=20,
dim=512,
hidden_dim=64
)
# a batch of sequences with 10 timesteps of length 512 each
x = torch.rand(32, 10, 512)
y = layer(x) # [32, 10, 512]
AFTLocalfrom aft_pytorch import AFTLocal
layer = AFTLocal(
max_seqlen=20,
dim=512,
hidden_dim=64
)
# a batch of sequences with 10 timesteps of length 512 each
x = torch.rand(32, 10, 512)
y = layer(x) # [32, 10, 512]
This layer wrapper is a 'plug-and-play' with your existing networks / Transformers. You can swap out the Self-Attention layer with the available layers in this package with minimal changes.
AFTConv, AFTLocalIf you like this repo, please leave a star! If there are any amends or suggestions, feel free to raise a PR/issue.
@misc{attention-free-transformer,
title = {An Attention Free Transformer},
author = {Shuangfei Zhai and Walter Talbott and Nitish Srivastava and Chen Huang and Hanlin Goh and Ruixiang Zhang and Josh Susskind},
year = {2021},
URL = {https://arxiv.org/pdf/2105.14103.pdf}
}
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.2 | 11 Jun 2021 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:15 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:ec0e47e8b977fd117a97d9bcb9a0387c893b20e7512bafe4b4a515e9957ca330