Keras 3: Train JAX Models with model.fit, Keras Hub, and Keras Recommenders
Google for DevelopersMay 21, 202519 min1,660 views
37 connectionsΒ·40 entities in this videoβKeras Ecosystem and JAX Integration
- π‘ The Keras ecosystem provides multiple entry points for using JAX, from simple
model.fitloops to advanced model parallel distribution. - π οΈ Keras offers a comprehensive toolbox for deep learning, including
model.compile,model.fit, andmodel.summaryfor building and training JAX models. - β
Keras supports various optimizers, losses, metrics, and callbacks, all compatible with the
model.fittraining loop abstraction.
Advanced Training with Keras
- π Keras follows the principle of progressive disclosure of complexity, allowing users to customize
model.fitfor advanced training loops. - π» Multi-device distribution can be enabled using Keras's distribution APIs, including
DeviceMeshandLayoutMapfor sharding model weights. - βοΈ For ultimate control, users can override core training steps, such as
compute_lossandupdates, for custom loss functions and tailored training loops.
Backend Agnosticism and Keras Hub
- π Keras APIs are backend-agnostic, supporting JAX, TensorFlow, and PyTorch, with the ability to switch backends easily by setting an environmental variable.
- π§© You can mix and match training frameworks and data pipelines, for example, using a TF.data pipeline with a JAX backend.
- π Keras Hub offers a rich collection of over 211 model variants based on 44+ architectures like Gemma, Llama, and Stable Diffusion, ready for use with JAX, TensorFlow, or PyTorch.
- π€ Keras Hub integrates seamlessly with platforms like Kaggle and Hugging Face, providing access to presets, checkpoints, and community guides.
Fine-tuning and Model Components
- π― Keras Hub models can be fine-tuned using standard
model.fitor advanced techniques like LoRA and QLoRA for parameter-efficient training. - π§© Task models in Keras Hub consist of a backbone, a pre-processor, and a task head, simplifying the pipeline from raw data to predictions.
- π§ Components like backbones, pre-processors, and tokenizers can be instantiated using the
from_presetmethod for easy integration of pre-trained weights and configurations.
Keras Recommenders
- π― Keras Recommenders is a new library for building state-of-the-art recommendation systems with JAX, TensorFlow, or PyTorch.
- π It supports a two-phase approach (retrieval and ranking) and multitask models, with specialized layers, losses, and metrics for recommender models.
- π§ Sequential recommender models, like GRU4Rec, can be built using a two-tower architecture with Keras Recommenders and trained with
model.fit. - βοΈ The distributed embedding layer in Keras Recommenders leverages specialized hardware like Google's TPUs for efficient handling of large embedding tables across multiple devices.
Knowledge graph40 entities Β· 37 connections
How they connect
An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.
Hover Β· drag to explore
40 entities
Chapters8 moments
Key Moments
Transcript71 segments
Full Transcript
Topics15 themes
Whatβs Discussed
KerasJAXmodel.fitDeep LearningMachine LearningKeras HubKeras RecommendersLoRAQLoRADistributed TrainingModel ParallelismRecommendation SystemsEmbeddingsTensorFlowPyTorch
Smart Objects40 Β· 37 links
ProductsΒ· 8
ConceptsΒ· 22
CompaniesΒ· 4
MediasΒ· 5
LocationΒ· 1