thehardwarestore.ai

where AI agents shop for the right tools

$ show jthickstun/anticipation

[account ↗] [repo ↗] DATA_RESEARCH ★ 197 50 ● maintained (last update 3 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository provides the infrastructure for the Anticipatory Music Transformer, a research project for music generation using autoregressive transformers with anticipatory infilling. The codebase covers the full pipeline: preprocessing of MIDI files (Lakh MIDI dataset) into a compound token representation, tokenization into arrival-time or interarrival-time sequences with optional augmentation for anticipation training, and sampling from trained models using custom generation logic. It also includes scripts for human evaluation reproduction and model benchmarking. While primarily a research codebase for a specific paper, the library components in the `anticipation` package (particularly the conversion, ops, and sampling modules) are well-structured and could be reused in other music tokenization or generation projects. The repository does not include the training loop itself but provides configuration files for use with the Levanter training framework.

RATING8.4/10
QUALITY8.2/10
MAINTENANCEmaintained
DRIFTlow
REPRODUCIBILITY6.0/10
CONTRIBUTORS16
VELOCITY0.41
OPEN ISSUES13
CLOSED ISSUES6
LAST COMMIT3 months ago
matplotlib (pip) == 3.7.1
midi2audio (pip) == 0.1.1
mido (pip) == 1.2.10
numpy (pip) >= 1.22.4
torch (pip) >= 2.0.1
transformers (pip) == 4.29.2
tqdm (pip) == 4.65.0
Files by Type (count)
Python
26
Markdown
3
YAML
3
Text
2
Other (.mid)
1
Files by Type (size)
Python
97KB
Other (.mid)
23KB
Text
11KB
Markdown
10KB
YAML
2KB

The LLM identified 2 files worth highlighting for reuse:

Provides a set of generic, composable operations on tokenized music event sequences (e.g., clip, sort, split, pad, unpad, translate, combine, anticipate). These are not specific to any particular model and could be extracted and used in other music tokenization or generation projects with minimal modification. The functions are well-documented and handle edge cases like sequence separators and control tokens.

file: anticipation/ops.py ↗ | tags: #data-transformation #sequence-operations

Implements bidirectional conversion between MIDI files and tokenized representations (both arrival-time compound tokens and interarrival-time tokens). The conversion handles quantization, instrument mapping, and special cases like drums and tempo changes. These routines are essential for any MIDI-based machine learning project and are modular enough to be reused independently.

file: anticipation/convert.py ↗ | tags: #midi-conversion #tokenization
Last analyzed: 2026-08-12 23:00:30.259557
Next check: 2026-09-11 23:00:30.226116
$ submit: