Skip to Content
Deep Learning with Keras
book

Deep Learning with Keras

by Antonio Gulli, Sujit Pal
April 2017
Intermediate to advanced
318 pages
7h 40m
English
Packt Publishing
Content preview from Deep Learning with Keras

API changes

The Keras 2.0 changes implied the need to rethink some APIs. For full details, please refer to the release notes (https://github.com/fchollet/keras/wiki/Keras-2.0-release-notes). This module legacy.py summarizes the most impactful changes and prevents warnings when using Keras 1.x calls:

""Utility functions to avoid warnings while testing both Keras 1 and 2."""import keraskeras_2 = int(keras.__version__.split(".")[0]) > 1 # Keras > 1def fit_generator(model, generator, epochs, steps_per_epoch):    if keras_2:        model.fit_generator(generator, epochs=epochs, steps_per_epoch=steps_per_epoch)    else:        model.fit_generator(generator, nb_epoch=epochs, samples_per_epoch=steps_per_epoch)def fit(model, x, y, nb_epoch=10, *args, **kwargs): if keras_2: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Deep Learning with Keras

Advanced Deep Learning with Keras

Rowel Atienza, Neeraj Verma, Valerio Maggio
Deep Learning with TensorFlow 2 and Keras - Second Edition

Deep Learning with TensorFlow 2 and Keras - Second Edition

Antonio Gulli, Dr. Amita Kapoor, Sujit Pal

Publisher Resources

ISBN: 9781787128422Supplemental Content