Tue 14 March 2017
Keras was released two years ago, in March 2015. It then proceeded to grow from one user to one hundred thousand.
Hundreds of people have contributed to the Keras codebase. Many thousands have contributed to the community. Keras has enabled new startups, made researchers more productive, simplified the workflows of engineers at large companies, and opened up deep learning to thousands of people with no prior machine learning experience. And we believe this is just the beginning.
Now we are releasing Keras 2, with a new API (even easier to use!) that brings consistency with TensorFlow. This is a major step in preparation for the integration of the Keras API in core TensorFlow.
Many things have changed. This is your quick summary.
Although Keras has supported TensorFlow as a runtime backend since December 2015, the Keras API had so far been kept separate from the TensorFlow codebase. This is changing: the Keras API will now become available directly as part of TensorFlow, starting with TensorFlow 1.2. This is a big step towards making TensorFlow accessible to its next million users.
Keras is best understood as an API specification, not as a specific codebase. In fact, going fowards there will be two separate implementations of the Keras spec: the internal TensorFlow one, available as
tf.keras, written in pure TensorFlow and deeply compatible with all TensorFlow functionality, and the external multi-backend one supporting both Theano and TensorFlow (and likely even more backends in the future).
The new Keras 2 API is our first long-term-support API: codebases written in Keras 2 next month should still run many years from now, on up-to-date software. To make this possible, we have extensively redesigned the API with this release, preempting most future issues. In particular, our new API choices are fully compatible with TensorFlow conventions.
The API of most layers has significantly changed, in particular
BatchNormalization, and all convolutional layers. However, we have set up compatibility interfaces so that your Keras 1 code will still run in Keras 2 without issues (while printing warnings to help you convert your layer calls to the new API).
The API of generator training & evaluation methods has changed (i.e.
evaluate_generator). Again, no worries: your Keras 1 calls will still work in Keras 2.
nb_epoch has been renamed
epochs. This change is also handled by our API conversion interfaces.
The saved weights format for many layers has changed. However, weights files saved with Keras 1 can still be loaded in Keras 2 models.
objectives module has been renamed
Keeping in mind the large user base of Keras, we have done our best to minimize the number of breaking changes. However, some breakages are inevitable, especially for more advanced users.
The legacy layers
Highway have been permanently removed.
A number of legacy metrics and loss functions have been removed.
BatchNormalization layer no longer supports the
Because Keras internals have changed, custom layers have to be updated. Relatively little has changed, so it should be quick and easy. See
this guide. In general, any piece of code that used undocumented Keras functionality could have broken, so advanced users may have some updating to do.
Thanks to our contributors
Lots of people have committed code that has contributed specifically to the Keras 2 release. Many thanks to:
Abhai Kollara Dilip
Daniel Høyer Iversen
Gijs van Tulder
Hannah Vivian Shaw
Joseph Jin-Chuan Tang