Home  >  Article  >  Technology peripherals  >  Keras 3.0 officially released: available for TensorFlow, JAX and PyTorch

Keras 3.0 officially released: available for TensorFlow, JAX and PyTorch

WBOY
WBOYforward
2023-11-29 15:43:451032browse
After 5 months of update iterations, Keras 3.0 is finally here.

"Big news: We just released version Keras 3.0!" François Chollet, the father of Keras, on X Expressed excitement. "Now you can run Keras on JAX, TensorFlow and PyTorch frameworks..."

Keras 3.0正式发布:可用于TensorFlow、JAX和PyTorch

Regarding this update, Keras officials stated that this version took them 5 years to complete. It took several months for the public beta to be completed. Keras 3.0 is a complete rewrite of Keras that allows you to run Keras workflows on top of JAX, TensorFlow, or PyTorch. The new version also has new large model training and deployment capabilities. You can choose the framework that suits you best, or switch from one framework to another based on your current goals.

Keras 3.0正式发布:可用于TensorFlow、JAX和PyTorch

Keras address: https://keras.io/keras_3/

has been used by more than 2.5 million Keras, used by developers, welcomes version 3.0

Keras API is available for JAX, TensorFlow and PyTorch. Existing tf.keras models using only built-in layers can be run in JAX and PyTorch!

Keras 3.0正式发布:可用于TensorFlow、JAX和PyTorch

Keras 3 works seamlessly with any JAX, TensorFlow and PyTorch workflow. Keras 3 is not only suitable for Keras-centric workflows such as defining Keras models, optimizers, losses and metrics, it is also designed to integrate seamlessly with JAX, TensorFlow and PyTorch low-level backend native workflows when training Keras models. , you can choose to use JAX training, TensorFlow training, PyTorch training, or use it as part of a JAX or PyTorch model. There is no problem with the above operations. Keras 3 provides the same degree of low-level implementation flexibility in JAX and PyTorch that tf.keras does in TensorFlow.

Keras 3.0正式发布:可用于TensorFlow、JAX和PyTorch

Pre-trained model. You can now use a variety of pretrained models in Keras 3. There are now 40 Keras application models available in the backend, in addition to a large number of pre-trained models existing in KerasCV and KerasNLP (such as BERT, T5, YOLOv8, Whisper, SAM etc) also applies to all backends.

Keras 3 is highly backwards compatible with Keras 2: Keras 3 now implements the public API interface of Keras 2. Most users can run Keras scripts on Keras 3 without changing any code. If you are not used to using Keras 3, you can choose to ignore the new version update and continue to use Keras 2 with TensorFlow.

Keras 3 supports cross-framework data pipeline for all backends. Multi-frame machine learning also means multi-frame data loading and preprocessing. Keras 3 models can be trained using a variety of data pipelines, whether you are using JAX, PyTorch or the TensorFlow backend:

  • tf.data. Dataset pipelines.
  • torch.utils.data.DataLoader object.
  • NumPy arrays and Pandas dataframes.
  • The keras.utils.PyDataset object for Keras.

A new distributed API for large-scale data parallelism and model parallelism. This update is currently only available for the JAX backend, with TensorFlow and PyTorch support coming soon.

As for why this change is being rolled out, the Keras team stated that in recent years, as the model size has become larger and larger, they want to shard the multi-device model ( sharding) problem provides Keras solution. The team designed the API to make model definition, training logic, and sharding configuration completely independent, which means that the model can be run as if it were on a single device. You can then add sharding configuration to any model while training the model.

Data parallelism (copying a small model identically on multiple devices) can be handled with just two lines:

Keras 3.0正式发布:可用于TensorFlow、JAX和PyTorch

Next is model parallelism. This API allows you to configure the layout of each variable and each output tensor via regular expressions. This makes it easy to quickly specify the same layout for an entire variable category.

Keras 3.0正式发布:可用于TensorFlow、JAX和PyTorch

Finally, the Keras team has collected many questions that everyone is concerned about and answered them. Interested readers can go to the Keras official website to learn more.

The above is the detailed content of Keras 3.0 officially released: available for TensorFlow, JAX and PyTorch. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jiqizhixin.com. If there is any infringement, please contact admin@php.cn delete