Attention Free Transformer - Pytorch
Project description
aft-pytorch
Unofficial PyTorch implementation of the Attention Free Transformer by Zhai, et al. [abs, pdf] from Apple Inc.
Installation
You can install aft-pytorch
via pip
:
pip install aft-pytorch
Usage
You can import the Attention Free Transformer (AFT
) from the package like so:
from aft_pytorch import AFTFullAttention
layer = AFTFullAttention(
tsteps=10,
dim=512,
hidden_dim=64,
heads=8
)
# a batch of sequences with 10 timesteps of length 512 each
x = torch.rand(32, 10, 512)
y = layer(x) # [32, 10, 512]
TODO
- Add full AFT architecture
Contributing
If you like this repo, please leave a star! If there are any ammends or suggestions, feel free to raise a PR/issue.
Credits
@misc{
zhai2021an,
title={An Attention Free Transformer},
author={Shuangfei Zhai and Walter Talbott and Nitish Srivastava and Chen Huang and Hanlin Goh and Joshua M. Susskind},
year={2021},
url={https://openreview.net/forum?id=pW--cu2FCHY}
}
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aft_pytorch-0.0.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for aft_pytorch-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59dd46cbd7e840f0644742d0bbb9012774cc3db8187d9b3a265a70b57f39f819 |
|
MD5 | e92d5bd40ff93bfb050dc9588e5881c2 |
|
BLAKE2b-256 | ec6c8b7fcf8c075280d0259ed066159d6e5346ddb28e82298291f11657ac2352 |