Skip to main content

ast - Pytorch

Project description

Multi-Modality

AST

Implementation of AST from the paper: "AST: Audio Spectrogram Transformer' in PyTorch and Zeta. In this implementation we basically take an 2d input tensor representing audio -> then patchify it -> linear proj -> then position embeddings -> then attention and feedforward in a loop for layers. Please Join Agora and tag me if this could be improved in any capacity.

Install

pip3 install ast-torch

Usage

import torch
from ast_torch.model import ASTransformer

# Create dummy data
x = torch.randn(2, 16)

# Initialize model
model = ASTransformer(
    dim=4, seqlen=16, dim_head=4, heads=4, depth=2, patch_size=4
)

# Run model and print output shape
print(model(x).shape)

Citation

@misc{gong2021ast,
    title={AST: Audio Spectrogram Transformer}, 
    author={Yuan Gong and Yu-An Chung and James Glass},
    year={2021},
    eprint={2104.01778},
    archivePrefix={arXiv},
    primaryClass={cs.SD}
}

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ast_torch-0.0.5.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ast_torch-0.0.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file ast_torch-0.0.5.tar.gz.

File metadata

  • Download URL: ast_torch-0.0.5.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

File hashes

Hashes for ast_torch-0.0.5.tar.gz
Algorithm Hash digest
SHA256 2db6f9d1c9b9f732881a1328905e084ef6073b7fda858d4aa12bb79a6d86582c
MD5 0dac2ae3aaef4391931c40ba2c45ef40
BLAKE2b-256 89495c19a9ad444f07eea9d7f4e051a24ff0364e4151431f1b151e596c98b189

See more details on using hashes here.

File details

Details for the file ast_torch-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: ast_torch-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.11.0 Darwin/22.4.0

File hashes

Hashes for ast_torch-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1920586c09473c403878e20c3e483194d0d8f4137ea644d8d9a24ae49bc36e55
MD5 9c9ac66dd4ba09e6696016e8c9b7dc15
BLAKE2b-256 5ea1c942462042444954e43c5476d5868289268ef9b8993b31e40c5233b5a7ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page