All Versions
14
Latest Version
Avg Release Cycle
71 days
Latest Release
701 days ago

Changelog History
Page 1

  • v2.4.0 Changes

    June 17, 2020

    ๐Ÿš€ As previously announced, we have discontinued multi-backend Keras to refocus exclusively on the TensorFlow implementation of Keras.

    ๐Ÿ“ฆ In the future, we will develop the TensorFlow implementation of Keras in the present repo, at keras-team/keras. For the time being, it is being developed in tensorflow/tensorflow and distributed as tensorflow.keras. In this future, the keras package on PyPI will be the same as tf.keras.

    ๐Ÿš€ This release (2.4.0) simply redirects all APIs in the standalone keras package to point to tf.keras. This helps address user confusion regarding differences and incompatibilities between tf.keras and the standalone keras package. There is now only one Keras: tf.keras.

    • ๐Ÿš€ Note that this release may be breaking for some workflows when going from Keras 2.3.1 to 2.4.0. Test before upgrading.
    • Note that we still recommend that you import Keras as from tensorflow import keras, rather than import keras, for the time being.
  • v2.3.1 Changes

    October 07, 2019

    ๐Ÿš€ Keras 2.3.1 is a minor bug-fix release. In particular, it fixes an issue with using Keras models across multiple threads.

    ๐Ÿ”„ Changes

    • ๐Ÿ› Bug fixes
    • ๐Ÿ“š Documentation fixes
    • No API changes
    • No breaking changes
  • v2.3.0 Changes

    September 17, 2019

    ๐Ÿš€ Keras 2.3.0 is the first release of multi-backend Keras that supports TensorFlow 2.0. It maintains compatibility with TensorFlow 1.14, 1.13, as well as Theano and CNTK.

    ๐Ÿš€ This release brings the API in sync with the tf.keras API as of TensorFlow 2.0. However note that it does not support most TensorFlow 2.0 features, in particular eager execution. If you need these features, use tf.keras.

    ๐Ÿš€ This is also the last major release of multi-backend Keras. Going forward, we recommend that users consider switching their Keras code to tf.keras in TensorFlow 2.0. 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.

    ๐Ÿ”€ Development will focus on tf.keras going forward. We will keep maintaining multi-backend Keras over the next 6 months, but we will only be merging bug fixes. API changes will not be ported.

    API changes

    • โž• Add size(x) to backend API.
    • add_metric method added to Layer / Model (used in a similar way as add_loss, but for metrics), as well as the metrics property.
    • Variables set as attributes of a Layer are now tracked in layer.weights (including layer.trainable_weights or layer.non_trainable_weights as appropriate).
    • Layers set as attributes of a Layer are now tracked (so the weights/metrics/losses/etc of a sublayer are tracked by parent layers). This behavior already existed for Model specifically and is now extended to all Layer subclasses.
    • Introduce class-based losses (inheriting from Loss base class). This enables losses to be parameterized via constructor arguments. Loss classes added:
      • MeanSquaredError
      • MeanAbsoluteError
      • MeanAbsolutePercentageError
      • MeanSquaredLogarithmicError
      • BinaryCrossentropy
      • CategoricalCrossentropy
      • SparseCategoricalCrossentropy
      • Hinge
      • SquaredHinge
      • CategoricalHinge
      • Poisson
      • LogCosh
      • KLDivergence
      • Huber
    • ๐Ÿ‘ Introduce class-based metrics (inheriting from Metric base class). This enables metrics to be stateful (e.g. required for supported AUC) and to be parameterized via constructor arguments. Metric classes added:
      • 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
    • Add reset_metrics argument to train_on_batch and test_on_batch. Set this to True to maintain metric state across different batches when writing lower-level training/evaluation loops. If False, the metric value reported as output of the method call will be the value for the current batch only.
    • โž• Add model.reset_metrics() method to Model. Use this at the start of an epoch to clear metric state when writing lower-level training/evaluation loops.
    • โšก๏ธ Rename lr to learning_rate for all optimizers.
    • โšก๏ธ Deprecate argument decay for all optimizers. For learning rate decay, use LearningRateSchedule objects in tf.keras.

    ๐Ÿ’ฅ Breaking changes

    • TensorBoard callback:
      • batch_size argument is deprecated (ignored) when used with TF 2.0
      • write_grads is deprecated (ignored) when used with TF 2.0
      • embeddings_freq, embeddings_layer_names, embeddings_metadata, embeddings_data are deprecated (ignored) when used with TF 2.0
    • ๐Ÿ”„ Change loss aggregation mechanism to sum over batch size. This may change reported loss values if you were using sample weighting or class weighting. You can achieve the old behavior by making sure your sample weights sum to 1 for each batch.
    • Metrics and losses are now reported under the exact name specified by the user (e.g. if you pass metrics=['acc'], your metric will be reported under the string "acc", not "accuracy", and inversely metrics=['accuracy'] will be reported under the string "accuracy".
    • ๐Ÿ”„ Change default recurrent activation to sigmoid (from hard_sigmoid) in all RNN layers.
  • v2.2.5 Changes

    August 22, 2019

    ๐Ÿš€ Keras 2.2.5 is the last release of Keras that implements the 2.2.* API. It is the last release to only support TensorFlow 1 (as well as Theano and CNTK).

    ๐Ÿš€ The next release will be 2.3.0, which makes significant API changes and add support for TensorFlow 2.0. The 2.3.0 release will be the last major release of multi-backend Keras. Multi-backend Keras is superseded by tf.keras.

    ๐Ÿ‘ At this time, we recommend that Keras users who use multi-backend Keras with the TensorFlow backend switch to tf.keras in TensorFlow 2.0. tf.keras is better maintained and has better integration with TensorFlow features.

    API Changes

    • โž• Add new Applications: ResNet101, ResNet152, ResNet50V2, ResNet101V2, ResNet152V2.
    • Callbacks: enable callbacks to be passed in evaluate and predict.
      • Add callbacks argument (list of callback instances) in evaluate and predict.
      • Add callback methods on_train_batch_begin, on_train_batch_end, on_test_batch_begin, on_test_batch_end, on_predict_batch_begin, on_predict_batch_end, as well as on_test_begin, on_test_end, on_predict_begin, on_predict_end. Methods on_batch_begin and on_batch_end are now aliases for on_train_batch_begin and on_train_batch_end.
    • Allow file pointers in save_model and load_model (in place of the filepath)
    • โž• Add name argument in Sequential constructor
    • Add validation_freq argument in fit, controlling the frequency of validation (e.g. setting validation_freq=3 would run validation every 3 epochs)
    • ๐Ÿ‘ Allow Python generators (or Keras Sequence objects) to be passed in fit, evaluate, and predict, instead of having to use *_generator methods.
      • Add generator-related arguments max_queue_size, workers, use_multiprocessing to these methods.
    • โž• Add dilation_rate argument in layer DepthwiseConv2D.
    • MaxNorm constraint: rename argument m to max_value.
    • โž• Add dtype argument in base layer (default dtype for layer's weights).
    • Add Google Cloud Storage support for model.save_weights and model.load_weights.
    • โž• Add JSON-serialization to the Tokenizer class.
    • Add H5Dict and model_to_dot to utils.
    • ๐Ÿ‘ Allow default Keras path to be specified at startup via environment variable KERAS_HOME.
    • Add arguments expand_nested, dpi to plot_model.
    • โž• Add update_sub, stack, cumsum, cumprod, foldl, foldr to CNTK backend
    • Add merge_repeated argument to ctc_decode in TensorFlow backend

    ๐Ÿš€ Thanks to the 89 committers who contributed code to this release!

  • v2.2.4 Changes

    October 03, 2018

    ๐Ÿ›  This is a bugfix release, addressing two issues:

    • Ability to save a model when a file with the same name already exists.
    • Issue with loading legacy config files for the Sequential model.

    ๐Ÿš€ See here for the changelog since 2.2.2.

  • v2.2.3 Changes

    October 01, 2018

    Areas of improvement

    • API completeness & usability improvements
    • ๐Ÿ› Bug fixes
    • ๐Ÿ“š Documentation improvements

    API changes

    • Keras models can now be safely pickled.
    • Consolidate the functionality of the activation layers ThresholdedReLU and LeakyReLU into the ReLU layer.
    • As a result, the ReLU layer now takes new arguments negative_slope and threshold, and the relu function in the backend takes a new threshold argument.
    • โž• Add update_freq argument in TensorBoard callback, controlling how often to write TensorBoard logs.
    • โž• Add the exponential function to keras.activations.
    • โž• Add data_format argument in all 4 Pooling1D layers.
    • โž• Add interpolation argument in UpSampling2D layer and in resize_images backend function, supporting modes "nearest" (previous behavior, and new default) and "bilinear" (new).
    • Add dilation_rate argument in Conv2DTranspose layer and in conv2d_transpose backend function.
    • The LearningRateScheduler now receives the lr key as part of the logs argument in on_epoch_end (current value of the learning rate).
    • ๐Ÿ‘‰ Make GlobalAveragePooling1D layer support masking.
    • The the filepath argument save_model and model.save() can now be a h5py.Group instance.
    • Add argument restore_best_weights to EarlyStopping callback (optionally reverts to the weights that obtained the highest monitored score value).
    • โž• Add dtype argument to keras.utils.to_categorical.
    • Support run_options and run_metadata as optional session arguments in model.compile() for the TensorFlow backend.

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿ— Modify the return value of Sequential.get_config(). Previously, the return value was a list of the config dictionaries of the layers of the model. Now, the return value is a dictionary with keys layers, name, and an optional key build_input_shape. The old config is equivalent to new_config['layers']. This makes the output of get_config consistent across all model classes.

    Credits

    ๐Ÿš€ Thanks to our 38 contributors whose commits are featured in this release:

    @BertrandDechoux, @ChrisGll, @Dref360, @JamesHinshelwood, @MarcoAndreaBuchmann, @ageron, @alfasst, @blue-atom, @chasebrignac, @cshubhamrao, @danFromTelAviv, @datumbox, @farizrahman4u, @fchollet, @fuzzythecat, @gabrieldemarmiesse, @hadifar, @heytitle, @hsgkim, @jankrepl, @joelthchao, @knightXun, @kouml, @linjinjin123, @lvapeab, @nikoladze, @ozabluda, @qlzh727, @roywei, @rvinas, @sriyogesh94, @tacaswell, @taehoonlee, @tedyu, @xuhdev, @yanboliang, @yongzx, @yuanxiaosc

  • v2.2.2 Changes

    July 28, 2018

    This is a bugfix release, fixing a significant bug in multi_gpu_model.

    ๐Ÿš€ For changes since version 2.2.0, see release notes for Keras 2.2.1.

  • v2.2.1 Changes

    July 27, 2018

    Areas of improvement

    • ๐Ÿ› Bugs fixes
    • ๐ŸŽ Performance improvements
    • ๐Ÿ“š Documentation improvements

    API changes

    • โž• Add output_padding argument in Conv2DTranspose (to override default padding behavior).
    • Enable automatic shape inference when using Lambda layers with the CNTK backend.

    ๐Ÿ’ฅ Breaking changes

    No breaking changes recorded.

    Credits

    ๐Ÿš€ Thanks to our 33 contributors whose commits are featured in this release:

    @Ajk4, @Anner-deJong, @Atcold, @Dref360, @EyeBool, @ageron, @briannemsick, @cclauss, @davidtvs, @dstine, @eTomate, @ebatuhankaynak, @eliberis, @farizrahman4u, @fchollet, @fuzzythecat, @gabrieldemarmiesse, @jlopezpena, @kamil-kaczmarek, @kbattocchi, @kmader, @kvechera, @maxpumperla, @mkaze, @pavithrasv, @rvinas, @sachinruk, @seriousmac, @soumyac1999, @taehoonlee, @yanboliang, @yongzx, @yuyang-huang

  • v2.2.0 Changes

    June 06, 2018

    Areas of improvements

    • ๐Ÿ†• New model definition API: Model subclassing.
    • ๐Ÿ†• New input mode: ability to call models on TensorFlow tensors directly (TensorFlow backend only).
    • ๐Ÿ‘Œ Improve feature coverage of Keras with the Theano and CNTK backends.
    • ๐Ÿ› Bug fixes and performance improvements.
    • ๐Ÿ”จ Large refactors improving code structure, code health, and reducing test time. In particular:
      • The Keras engine now follows a much more modular structure.
      • The Sequential model is now a plain subclass of Model.
      • The modules applications and preprocessing are now externalized to their own repositories (keras-applications and keras-preprocessing).

    API changes

    • โž• Add Model subclassing API (details below).
    • ๐Ÿ‘ Allow symbolic tensors to be fed to models, with TensorFlow backend (details below).
    • Enable CNTK and Theano support for layers SeparableConv1D, SeparableConv2D, as well as backend methods separable_conv1d and separable_conv2d (previously only available for TensorFlow).
    • ๐Ÿ‘ Enable CNTK and Theano support for applications Xception and MobileNet (previously only available for TensorFlow).
    • โž• Add MobileNetV2 application (available for all backends).
    • ๐Ÿ”ง Enable loading external (non built-in) backends by changing your ~/.keras.json configuration file (e.g. PlaidML backend).
    • โž• Add sample_weight in ImageDataGenerator.
    • โž• Add preprocessing.image.save_img utility to write images to disk.
    • 0๏ธโƒฃ Default Flatten layer's data_format argument to None (which defaults to global Keras config).
    • ๐Ÿ—„ Sequential is now a plain subclass of Model. The attribute sequential.model is deprecated.
    • โž• Add baseline argument in EarlyStopping (stop training if a given baseline isn't reached).
    • โž• Add data_format argument to Conv1D.
    • Make the model returned by multi_gpu_model serializable.
    • ๐Ÿ‘Œ Support input masking in TimeDistributed layer.
    • โž• Add an advanced_activation layer ReLU, making the ReLU activation easier to configure while retaining easy serialization capabilities.
    • โž• Add axis=-1 argument in backend crossentropy functions specifying the class prediction axis in the input tensor.

    ๐Ÿ†• New model definition API : Model subclassing

    In addition to the Sequential API and the functional Model API, you may now define models by subclassing the Model class and writing your own call forward pass:

    import kerasclass SimpleMLP(keras.Model): def \_\_init\_\_(self, use\_bn=False, use\_dp=False, num\_classes=10): super(SimpleMLP, self).\_\_init\_\_(name='mlp') self.use\_bn = use\_bn self.use\_dp = use\_dp self.num\_classes = num\_classes self.dense1 = keras.layers.Dense(32, activation='relu') self.dense2 = keras.layers.Dense(num\_classes, activation='softmax') if self.use\_dp: self.dp = keras.layers.Dropout(0.5) if self.use\_bn: self.bn = keras.layers.BatchNormalization(axis=-1) def call(self, inputs): x = self.dense1(inputs) if self.use\_dp: x = self.dp(x) if self.use\_bn: x = self.bn(x) return self.dense2(x) model = SimpleMLP() model.compile(...) model.fit(...)
    

    Layers are defined in __init__ (self, ...), and the forward pass is specified in call(self, inputs). In call, you may specify custom losses by calling self.add_loss(loss_tensor) (like you would in a custom layer).

    ๐Ÿ†• New input mode: symbolic TensorFlow tensors

    With Keras 2.2.0 and TensorFlow 1.8 or higher, you may fit, evaluate and predict using symbolic TensorFlow tensors (that are expected to yield data indefinitely). The API is similar to the one in use in fit_generator and other generator methods:

    iterator = training\_dataset.make\_one\_shot\_iterator() x, y = iterator.get\_next() model.fit(x, y, steps\_per\_epoch=100, epochs=10) iterator = validation\_dataset.make\_one\_shot\_iterator() x, y = iterator.get\_next() model.evaluate(x, y, steps=50)
    

    ๐ŸŽ This is achieved by dynamically rewiring the TensorFlow graph to feed the input tensors to the existing model placeholders. There is no performance loss compared to building your model on top of the input tensors in the first place.

    ๐Ÿ’ฅ Breaking changes

    • โœ‚ Remove legacy Merge layers and associated functionality (remnant of Keras 0), which were deprecated in May 2016, with full removal initially scheduled for August 2017. Models from the Keras 0 API using these layers cannot be loaded with Keras 2.2.0 and above.
    • The truncated_normal base initializer now returns values that are scaled by ~0.9 (resulting in correct variance value after truncation). This has a small chance of affecting initial convergence behavior on some models.

    Credits

    ๐Ÿš€ Thanks to our 46 contributors whose commits are featured in this release:

    @ASvyatkovskiy, @AmirAlavi, @Anirudh-Swaminathan, @DavidAriel, @Dref360, @JonathanCMitchell, @KuzMenachem, @PeterChe1990, @Saharkakavand, @StefanoCappellini, @ageron, @askskro, @bileschi, @bonlime, @bottydim, @brge17, @briannemsick, @bzamecnik, @christian-lanius, @clemens-tolboom, @dschwertfeger, @dynamicwebpaige, @farizrahman4u, @fchollet, @fuzzythecat, @ghostplant, @giuscri, @huyu398, @jnphilipp, @masstomato, @morenoh149, @mrTsjolder, @nittanycolonial, @r-kellerm, @reidjohnson, @roatienza, @sbebo, @stevemurr, @taehoonlee, @tiferet, @tkoivisto, @tzerrell, @vkk800, @wangkechn, @wouterdobbels, @zwang36wang

  • v2.1.6 Changes

    April 23, 2018

    Areas of improvement

    • ๐Ÿ› Bug fixes
    • ๐Ÿ“š Documentation improvements
    • Minor usability improvements

    API changes

    • In callback ReduceLROnPlateau, rename epsilon argument to min_delta (backwards-compatible).
    • In callback RemoteMonitor, add argument send_as_json.
    • In backend softmax function, add argument axis.
    • In Flatten layer, add argument data_format.
    • In save_model (Model.save) and load_model functions, allow the filepath argument to be a h5py.File object.
    • In Model.evaluate_generator, add verbose argument.
    • In Bidirectional wrapper layer, add constants argument.
    • In multi_gpu_model function, add arguments cpu_merge and cpu_relocation (controlling whether to force the template model's weights to be on CPU, and whether to operate merge operations on CPU or GPU).
    • In ImageDataGenerator, allow argument width_shift_range to be int or 1D array-like.

    ๐Ÿ’ฅ Breaking changes

    ๐Ÿš€ This release does not include any known breaking changes.

    Credits

    ๐Ÿš€ Thanks to our 37 contributors whose commits are featured in this release:

    @Dref360, @FirefoxMetzger, @Naereen, @NiharG15, @StefanoCappellini, @WindQAQ, @dmadeka, @edrogers, @eltronix, @farizrahman4u, @fchollet, @gabrieldemarmiesse, @ghostplant, @jedrekfulara, @jlherren, @joeyearsley, @johanahlqvist, @johnyf, @jsaporta, @kalkun, @lucasdavid, @masstomato, @mrlzla, @myutwo150, @nisargjhaveri, @obi1kenobi, @olegantonyan, @ozabluda, @pasky, @Planck35, @sotlampr, @souptc, @srjoglekar246, @stamate, @taehoonlee, @vkk800, @xuhdev