HaloNet - Pytorch
Implementation of the Attention layer from the paper, Scaling Local Self-Attention For Parameter Efficient Visual Backbones. This repository will only house the attention layer and not much more.
Install
$ pip install halonet-pytorch
Usage
import torch
from halonet_pytorch import HaloAttention
attn = HaloAttention(
dim = 512, # dimension of feature map
block_size = 8, # neighborhood block size (feature map must be divisible by this)
halo_size = 4, # halo size (block receptive field)
dim_head = 64, # dimension of each head
heads = 4 # number of attention heads
).cuda()
fmap = torch.randn(1, 512, 32, 32).cuda()
attn(fmap) # (1, 512, 32, 32)
Citations
@misc{vaswani2021scaling,
title = {Scaling Local Self-Attention For Parameter Efficient Visual Backbones},
author = {Ashish Vaswani and Prajit Ramachandran and Aravind Srinivas and Niki Parmar and Blake Hechtman and Jonathon Shlens},
year = {2021},
eprint = {2103.12731},
archivePrefix = {arXiv},
primaryClass = {cs.CV}
}
Metadata
Release files for halonet-pytorch 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| halonet_pytorch-0.0.5.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| halonet_pytorch-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / halonet_pytorch-0.0.5.tar.gz
| Download URL | halonet_pytorch-0.0.5.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad850dad2ae6a815fc67752d9a06f88a3580b6a419aa5c8fcea3c17d315bbd6a
|
|
BLAKE2b-256 checksum How to use checksums |
9df8d1d786c68242675d4549b6339fb7c5e871cbfb0db85a060f6de9b557bb3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Release files / halonet_pytorch-0.0.5-py3-none-any.whl
| Download URL | halonet_pytorch-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07cd56caa71dd7d6c1a3b9a62f7e52b9b47c657365958f58dfde15932811b30a
|
|
BLAKE2b-256 checksum How to use checksums |
eaa3cfedf9f678f32cad02a3b830f7c9831b571047b81a1b869ae241a0a29a95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|