executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
lstm-generationRun, adapt, or modernize deepjazz's legacy LSTM generation workflow safely.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task is to run, adapt, troubleshoot, or modernize the legacy deepjazz LSTM generation path: preprocess grammar corpus, build/train the Keras/Theano model, generate measure grammars, prune/QA, unparse to notes, and write MIDI.
This skill distills the relevant generation and model behavior into the bundled references below. Do not depend on reading legacy source files at runtime to recover constants, APIs, or control flow.
../midi-preprocessing/.../grammar-and-qa/.Use a legacy environment for faithful execution: Python 2.7, Keras 1.2.x, Theano 0.9.x, NumPy 1.16.x, and music21 3.1.x. Set KERAS_BACKEND=theano before importing Keras when using the legacy stack.
Before any training or playback-capable command, run the safe diagnostic:
python scripts/legacy_generation_check.py --check-imports --show-settings --expect-theano
To inspect API signatures in a local deepjazz-style working copy without training, playback, or writes:
python scripts/legacy_generation_check.py --repo-root <deepjazz-style-root> --check-imports --show-settings --expect-theano
Treat full generation as side-effectful: it trains an LSTM, attempts realtime MIDI playback, and writes a MIDI file. On headless servers, use an adapted entrypoint that disables playback before invoking generation.
Treat Theano CUDA as a legacy optional acceleration path only. The CPU path is the safe baseline; the CUDA command requires an old NVIDIA/CUDA/Theano stack and is not verified by this skill.
references/generation-workflow.md for the public end-to-end generation flow, legacy CPU/GPU command shapes, constants, side effects, and headless one-epoch guidance.references/lstm-architecture.md for build_model(corpus, val_indices, max_len, N_epochs=128), one-hot shapes, layer stack, compile/fit parameters, and inference sampling shapes.references/modernization-notes.md when porting the model to Python 3 or tf.keras while preserving corpus/value mappings and the grammar pipeline.references/troubleshooting.md for backend mismatch, missing dependency, Python 3, Theano CUDA, playback, output-path, speed, and nondeterminism failures.scripts/legacy_generation_check.py for deterministic, no-training/no-playback dependency, backend, distilled-setting, and optional signature checks.| Area | Legacy behavior |
|---|---|
| Generator API | generate(data_fn, out_fn, N_epochs) trains, generates, plays, then writes MIDI. |
| Default CLI epoch count | 128 if the command-line epoch argument is absent or invalid. |
| Default input | Metheny MIDI fixture path under a midi/ directory. Route compatibility checks to midi-preprocessing. |
| Default output naming | deepjazz_on_metheny...<N>_epoch(s).midi under a midi/ directory. Prefer explicit .midi output paths in adaptations. |
| Model settings | max_len=20, max_tries=1000, diversity=0.5. |
| Music settings | tempo marker bpm=130. |
| Training | Two stacked LSTM(128) layers with dropout, categorical crossentropy, RMSprop, batch size 128, nb_epoch=N_epochs. |
| Safety hazards | Full generation can be slow, nondeterministic, playback-dependent, and write output files. The bundled helper avoids all of those side effects. |