Skip to main content

Module ast

Module ast 

Source
Expand description

AST — the Audio Spectrogram Transformer (MIT/ast-finetuned-audioset), a vanilla ViT over a log-mel spectrogram for audio classification. Pure Rust, CPU.

Structurally it is a ViT with an audio-specific stem: a strided Conv2d patch embed (16×16 kernel, stride 10×10 — the “10-10” in the model name — so patches OVERLAP), a CLS and a distillation token, learned absolute positions, N pre-LN transformer blocks, a final LayerNorm, and a head that averages the CLS + distillation outputs → LayerNorm → linear classifier.

Gated against transformers (export_ast.py): the transformer + head are driven from the oracle mel here; the Kaldi-fbank frontend is a separate stage.

Structs§

Ast
AstGpu
The AST transformer, resident on the GPU. Holds the CPU Ast for the stem/head + as oracle.