fix: fine-tune config and generator improvements

scripts/train.py: fix max_seq_len 256→320 (must match pretrained checkpoint);
increase epochs 15→50 and patience 5→10 to give the small corpus enough
gradient steps; reduce warmup 20→10 (was 22% of total steps).

scripts/generate.py: default to prepending the tonic chord when --prefix is
not given; add --no-tonic-anchor to opt out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-21 10:15:48 +03:00
parent 5307d49a9e
commit 2a3eb1783a
2 changed files with 17 additions and 4 deletions
+7 -3
View File
@@ -54,13 +54,17 @@ TRAIN_CFG = TrainConfig(
data_dir=DATA_DIR,
output=CHECKPOINT,
init_from=INIT_FROM,
epochs=15,
# Small corpus (~45 train files) → ~6 batches/epoch.
# 50 epochs × 6 = ~300 gradient steps; patience=10 gives a 60-step window.
epochs=50,
batch_size=8,
lr=1e-5,
warmup_steps=20,
warmup_steps=10,
patience=10,
seed=42,
device="auto",
max_seq_len=256,
# Must match pretrained checkpoint (max_seq_len=320).
max_seq_len=320,
)