Updated demo to work with newer version of JAX#2295
Updated demo to work with newer version of JAX#2295vinayak19th wants to merge 1 commit intokeras-team:masterfrom
Conversation
Since new versions of JAX don't support the abstraction using `__jax_array__` anymore, the old method of passing `keras.Variables` to `jax.jit` compiled functions doesn't work. This change fixes that by manually extracting the underlying jax arrays
Summary of ChangesHello @vinayak19th, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the JAX custom training loop guide to ensure compatibility with recent JAX versions. It addresses a breaking change where the implicit Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the JAX custom training loop guide for compatibility with newer JAX versions by extracting JAX arrays from Keras variables. No security vulnerabilities were found. However, the change is incomplete as a similar variable initialization for the second training loop example (including metrics) around line 415 in guides/writing_a_custom_training_loop_in_jax.py was missed, which will cause the guide to fail. Please apply the same fix to that section to ensure the entire guide is functional.
Since new versions of JAX don't support the abstraction using
__jax_array__anymore, the old method of passingkeras.Variablestojax.jitcompiled functions doesn't work.This change fixes that by manually extracting the underlying jax arrays