Add clean Path A proof of concept
Spoken-English math to Typst with a small from-scratch encoder-decoder Transformer, following the build guide: compile-checked synthetic data generator, shared BPE tokenizer, nn.Transformer model, training loop with an overfit sanity check, greedy decoding CLI, and evaluation on synthetic and hand-written test sets. ./run.sh runs the whole pipeline. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
5926731546
commit
fa472f8abd
20 files changed
+2398
-1
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# The whole Path A pipeline: data -> tokenizer -> overfit check -> train -> evaluate.
|
||||
# ./run.sh full run (200k pairs, small model, 8000 steps: ~20 min on an M-series Mac)
|
||||
# ./run.sh --quick smoke run in ~2 min (20k pairs, tiny model, 1500 steps)
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
command -v typst >/dev/null || { echo "typst CLI missing: brew install typst"; exit 1; }
|
||||
|
||||
if [[ "${1:-}" == "--quick" ]]; then
|
||||
N=20000; TRAIN=(--config tiny --steps 1500 --eval-every 500)
|
||||
else
|
||||
N=200000; TRAIN=()
|
||||
fi
|
||||
|
||||
uv sync -q
|
||||
echo "== 1/5 generate data"; uv run isotope-gen -n "$N"
|
||||
echo "== 2/5 train tokenizer"; uv run isotope-tokenizer
|
||||
echo "== 3/5 overfit 100 pairs"; uv run isotope-train --overfit 100
|
||||
echo "== 4/5 train"; uv run isotope-train ${TRAIN[@]+"${TRAIN[@]}"}
|
||||
echo "== 5/5 evaluate"; uv run isotope-eval
|
||||
echo
|
||||
echo 'Try it: uv run isotope "the integral from 0 to 1 of x squared dx"'
|
||||
Reference in new issue
Block a user