days
-6
-1
hours
0
-1
minutes
-5
-5
seconds
-4
-4
search
Plans going forward

Keras 2.3.0 is the last major release of multi-backend Keras

Sarah Schlothauer
keras
© Shutterstock / Liu Zishan

Keras version 2.3.0 is here, and it is the last major multi-backend release. Going forward, users are recommended to switch their code over to tf.keras in TensorFlow 2.0. This release brings API changes and a few breaking changes. Have a look under the hood and see what it includes, as well as what the plans are going forward.

Keras, the deep learning library written in Python, has a new release. Version 2.3.0 is now the first release that supports TensorFlow 2.0. This version adds a few breaking changes and API changes and maintains TensorFlow 1.14 and 1.13 compatibility.

For those new to the API, a quick introduction: Keras is a deep learning that’s user friendly and uses models as a way to organize layers. It allows for fast prototyping and supports convolutional networks and recurrent networks. It was created by François Chollet, author of Deep Learning with Python.

Let’s have a look under the hood and see what the new version includes, as well as the latest news and plans going forward.

Last major multi-backend release

Take note: this is the last major release of multi-backend Keras. This means that afterward, users are recommended to switch their code to tf.keras in TensorFlow 2.0. From now on, development will focus on tf.keras.

SEE ALSO: Building a custom machine learning model on Android with Tensorflow Lite

Maintainance for multi-backend Keras will continue for six months. However no new API changes will be ported and only bug fixes will be merged.

tf.keras is TensorFlow’s API for building and training deep learning modules. For more information on getting started, importing it into your TensorFlow program, and how to start building models, refer to the informative guide.

According to the GitHub changelog, the benefits of using tf.keras are numerous.

It implements the same Keras 2.3.0 API (so switching should be as easy as changing the Keras import statements), but it has many advantages for TensorFlow users, such as support for eager execution, distribution, TPU training, and generally far better integration between low-level TensorFlow and high-level concepts like Layer and Model. It is also better maintained.

https://github.com/keras-team/keras/releases/tag/2.3.0

Keras 2.3.0

Version 2.3.0 adds a long list of API changes. From the changelog, here are some of the highlights arriving with the latest release:

SEE ALSO: Top programming languages in 2019: Python sweeps the board

API changes

These API changes bring the release in sync with the tf.keras API.

  • Add size(x) to backend API
  • add_metric method added to Layer / Model
  • Class-based losses added:
    • MeanSquaredError
    • MeanAbsoluteError
    • MeanAbsolutePercentageError
    • MeanSquaredLogarithmicError
    • BinaryCrossentropy
    • CategoricalCrossentropy
    • SparseCategoricalCrossentropy
    • Hinge
    • SquaredHinge
    • CategoricalHinge
    • Poisson
    • LogCosh
    • KLDivergence
    • Huber
  • Renamed lr to learning_rate
  • All Layer subclasses: Layers set as attributes of a Layer are now tracked.
  • Class-based metrics introduced. Metrics can now be stateful.
    • Accuracy
    • MeanSquaredError
    • Hinge
    • CategoricalHinge
    • SquaredHinge
    • FalsePositives
    • TruePositives
    • FalseNegatives
    • TrueNegatives
    • BinaryAccuracy
    • CategoricalAccuracy
    • TopKCategoricalAccuracy
    • LogCoshError
    • Poisson
    • KLDivergence
    • CosineSimilarity
    • MeanAbsoluteError
    • MeanAbsolutePercentageError
    • MeanSquaredError
    • MeanSquaredLogarithmicError
    • RootMeanSquaredError
    • BinaryCrossentropy
    • CategoricalCrossentropy
    • Precision
    • Recall
    • AUC
    • SparseCategoricalAccuracy
    • SparseTopKCategoricalAccuracy
    • SparseCategoricalCrossentropy
  • Deprecated argument decay for all optimizers.

Breaking changes

A few breaking changes come with this release.

  • TensorBoard callback: When used with TensorFlow 2.0, batch_size argument, write_grads , embeddings_freq,  embeddings_layer_names,  embeddings_metadata, and embeddings_data are all deprecated/ignored.
  • Loss aggregation mechanism changed to sum over batch size
  • Metrics and losses now reported under the same name, set by the user.
  • Default recurrent activation changed to sigmoid in RNN layers.
Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat. She is also the editor for Conditio Humana, an online magazine about ethics, AI, and technology.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of