Skip to content

Fix Keras serialization for losses and NeuralDecisionTree#9

Merged
jrosenfeld13 merged 1 commit intomainfrom
fix/keras-serialization
Jan 24, 2026
Merged

Fix Keras serialization for losses and NeuralDecisionTree#9
jrosenfeld13 merged 1 commit intomainfrom
fix/keras-serialization

Conversation

@jrosenfeld13
Copy link
Contributor

@jrosenfeld13 jrosenfeld13 commented Jan 24, 2026

  • Add @register_keras_serializable and get_config() to SpearmanCorrelation
  • Add @register_keras_serializable and get_config() to CombinedLoss
  • Add @register_keras_serializable and get_config() to NeuralDecisionTree
  • Replace lambda initializer with Constant() in NeuralDecisionTree

Fixes pickle/model.save() for all custom Keras classes.


Note

Improves Keras save/load compatibility for custom components.

  • Adds @register_keras_serializable and get_config() to SpearmanCorrelation and CombinedLoss (exposes regularization_strength, mse_weight, spearman_weight, spearman_regularization)
  • Adds @register_keras_serializable, **kwargs passthrough, stored init params, and get_config() to NeuralDecisionTree
  • Replaces lambda initializer with initializers.Constant for temperature and feature mask weights

Written by Cursor Bugbot for commit 7f54f20. This will update automatically on new commits. Configure here.

- Add @register_keras_serializable and get_config() to SpearmanCorrelation
- Add @register_keras_serializable and get_config() to CombinedLoss
- Add @register_keras_serializable and get_config() to NeuralDecisionTree
- Replace lambda initializer with Constant() in NeuralDecisionTree

Fixes pickle/model.save() for all custom Keras classes.
@jrosenfeld13 jrosenfeld13 merged commit 6d2144f into main Jan 24, 2026
4 checks passed
@jrosenfeld13 jrosenfeld13 deleted the fix/keras-serialization branch January 24, 2026 21:40
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.

1 participant