Skip to content

Support pure Keras 3 keras_mdn_layer v0.7.0-alpha#65

Open
cpmpercussion wants to merge 7 commits intomainfrom
64-keras3-mdn-layer
Open

Support pure Keras 3 keras_mdn_layer v0.7.0-alpha#65
cpmpercussion wants to merge 7 commits intomainfrom
64-keras3-mdn-layer

Conversation

@cpmpercussion
Copy link
Owner

Summary

Closes #64

  • Switch keras-mdn-layer from v0.6.0 to v0.7.0-alpha (pure Keras 3, backend-agnostic)
  • Remove tensorflow-probability and tf-keras dependencies (no longer needed)
  • Fix TFLite conversion to work with Keras 3 custom layers (from_concrete_functions instead of from_keras_model)
  • Fix TFLite no-signature interpreter fallback to use positional input mapping and shape-based output identification
  • Simplify CI matrix: Python 3.11 + 3.12 × Ubuntu + macOS, using poetry-locked deps (TF 2.19.1)

What still works

  • All 96 existing tests pass
  • Existing bundled .tflite models (e.g. Roland S-1 config) load and run correctly
  • Training, inference (Keras, TFLite, Dummy), and TFLite conversion all functional

Still to test

Test plan

  • CI matrix passes on all 4 combinations (2 Python × 2 platform)
  • Verify bundled models still work: poetry run ./start_impsy.py run -c configs/roland-s-1.toml
  • Test training pipeline with real log data
  • Check that newly trained models convert to .tflite and run correctly

🤖 Generated with Claude Code

cpmpercussion and others added 7 commits March 20, 2026 17:11
…w-probability and tf-keras

- Replace keras-mdn-layer 0.6.0 with 0.7.0-alpha git dep (pure Keras 3, no tfp)
- Remove tensorflow-probability and tf-keras dependencies
- Fix TFLite conversion: use from_concrete_functions instead of from_keras_model
  (from_keras_model fails with Keras 3 custom layers on TF 2.16-2.19)
- Fix TFLite no-signature fallback: map inputs by position and outputs by shape
  instead of relying on tensor names (which differ across conversion methods)
- Simplify CI matrix to Python 3.11+3.12 x Ubuntu+macOS with poetry-locked deps
- Existing bundled .tflite models (e.g. Roland S-1) continue to work unchanged

Closes #64

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ilure)

The from_concrete_functions approach with serve(*args) produced TFLite
SignatureDefs with positional input keys (args_0, args_1, ...) on the
cp311 wheel, causing TfliteMDRNN._discover_output_keys to fail with
'Invalid Input name (inputs) for SignatureDef'. The cp312 wheel produced
no SignatureDef at all, so 3.12 accidentally worked via the fallback path.

from_keras_model preserves the model's named inputs in the SignatureDef
and the SignatureRunner works correctly on TF 2.19.1+ with Keras 3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support pure Keras 3 keras_mdn_layer

1 participant