Bump keras from 2.13.1 to 3.12.0
Bumps keras from 2.13.1 to 3.12.0.
Release notes
Sourced from keras's releases.
Keras 3.12.0
Highlights
Keras has a new model distillation API!
You now have access to an easy-to-use API for distilling large models into small models while minimizing performance drop on a reference dataset -- compatible with all existing Keras models. You can specify a range of different distillation losses, or create your own losses. The API supports multiple concurrent distillation losses at the same time.
Example:
# Load a model to distill teacher = ... # This is the model we want to distill it into student = ...Configure the process
distiller = Distiller( teacher=teacher, student=student, distillation_losses=LogitsDistillation(temperature=3.0), ) distiller.compile( optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'] )
Train the distilled model
distiller.fit(x_train, y_train, epochs=10)
Keras supports GPTQ quantization!
GPTQ is now built into the Keras API. GPTQ is a post-training, weights-only quantization method that compresses a model to int4 layer by layer. For each layer, it uses a second-order method to update weights while minimizing the error on a calibration dataset.
Learn how to use it in this guide.
Example:
model = keras_hub.models.Gemma3CausalLM.from_preset("gemma3_1b") gptq_config = keras.quantizers.GPTQConfig( dataset=calibration_dataset, tokenizer=model.preprocessor.tokenizer, weight_bits=4, group_size=128, num_samples=256, sequence_length=256, hessian_damping=0.01, symmetric=False, </tr></table>
... (truncated)
Commits
adbfd13Add warning toset_backendand more detailed example. (#21787)70598b7Fix typo in Distiller docstringeecd34fFix:keras.ops.quantileworks with tf graph execution (#21782)c2bc6cfSuport keras.op.view() to view the same data bitwise at a new dtype (#21763)10b51ceMake confusion metrics compilable. (#21775)18f79d6Fix negative index handling in MultiHeadAttention attention_axes (#21721)18e0364Support for extracting volume patches (#21759)dc5e42cfix sas metrics in jaxfit(#21765)1ba3b8fFix discretization discrepancy (#21769)53987a7Document thatset_backendrequires re-importing keras. (#21764)- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.