hackermusic scripts neural-beat
7 files

dump_fixtures.ts
export_small0.py
fetch_deps.py
make_goldens.py
parity.mjs
README.md
shell.nix
README.md

Reproducing the neural beat-tracking assets #

The app ships three artifacts made here, and nothing in the app's runtime depends on any of this tooling — the browser only ever loads the ONNX, the filterbank, and pure TS.

Artifact Where SHA-256
beat-this-small0.onnx public/models/ c27086473b01950bf2c1ba5e71c9f001d24d2edcc65975818ced348be58e881f
mel-filterbank.f32 public/models/ ca050f332df0f8c7ef9dc8a1c17e98b5778fc02d20088a8a9874584e877ee2b9
goldens + fixtures src/test/fixtures/neural/ regenerated together with the model; parity tests fail loudly if they disagree

Sources: CPJKU/beat_this (ISMIR 2024, MIT — code and weights). Checkpoint: small0.ckpt from https://cloud.cp.jku.at/public.php/dav/files/7ik4RrBKTS273gp/small0.ckpt (8 451 101 bytes, sha256 6074be2c4d490c5f6101fcc374a1ec72ae93456e23bb6019783b849f5dc7d47b).

Procedure (nix, once) #

git clone --depth 1 https://github.com/CPJKU/beat_this /tmp/beat_this
curl -sL https://cloud.cp.jku.at/public.php/dav/files/7ik4RrBKTS273gp/small0.ckpt -o /tmp/small0.ckpt
cd scripts/neural-beat
node --experimental-strip-types dump_fixtures.ts   # writes /tmp/neural-beat/inputs
python3 fetch_deps.py                              # pure-python deps into pylibs/
nix-shell shell.nix --run 'PYTHONPATH=$PWD/pylibs python3 export_small0.py'  # small0(-inline).onnx
nix-shell shell.nix --run 'PYTHONPATH=$PWD/pylibs python3 make_goldens.py'   # goldens
node parity.mjs                                    # ort-vs-torch check (run from the repo root)

The inline ONNX (single file, weights embedded) is what ships: copy /tmp/neural-beat/small0-inline.onnx to public/models/beat-this-small0.onnx, the filterbank and goldens per the table, and re-run the suite — every fixture in src/test/fixtures/neural/ was produced by the authors' own torch code, so a mismatch means the port and the reference disagree, which is the point.