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

Utilizing Keras built-in VGG-16 net module

Keras applications are pre-built and pre-trained deep learning models. Weights are downloaded automatically when instantiating a model and stored at ~/.keras/models/. Using built-in code is very easy:

from keras.models import Modelfrom keras.preprocessing import imagefrom keras.optimizers import SGDfrom keras.applications.vgg16 import VGG16import matplotlib.pyplot as pltimport numpy as npimport cv2# prebuild model with pre-trained weights on imagenetmodel = VGG16(weights='imagenet', include_top=True)sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)model.compile(optimizer=sgd, loss='categorical_crossentropy')# resize into VGG16 trained images' formatim = cv2.resize(cv2.imread('steam-locomotive.jpg'), ...
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