Book Image

Hands-On Deep Learning Architectures with Python

By : Yuxi (Hayden) Liu, Saransh Mehta
Book Image

Hands-On Deep Learning Architectures with Python

By: Yuxi (Hayden) Liu, Saransh Mehta

Overview of this book

Deep learning architectures are composed of multilevel nonlinear operations that represent high-level abstractions; this allows you to learn useful feature representations from the data. This book will help you learn and implement deep learning architectures to resolve various deep learning research problems. Hands-On Deep Learning Architectures with Python explains the essential learning algorithms used for deep and shallow architectures. Packed with practical implementations and ideas to help you build efficient artificial intelligence systems (AI), this book will help you learn how neural networks play a major role in building deep architectures. You will understand various deep learning architectures (such as AlexNet, VGG Net, GoogleNet) with easy-to-follow code and diagrams. In addition to this, the book will also guide you in building and training various deep architectures such as the Boltzmann mechanism, autoencoders, convolutional neural networks (CNNs), recurrent neural networks (RNNs), natural language processing (NLP), GAN, and more—all with practical implementations. By the end of this book, you will be able to construct deep models using popular frameworks and datasets with the required design patterns for each architecture. You will be ready to explore the potential of deep architectures in today's world.
Table of Contents (15 chapters)
Free Chapter
1
Section 1: The Elements of Deep Learning
5
Section 2: Convolutional Neural Networks
8
Section 3: Sequence Modeling
10
Section 4: Generative Adversarial Networks (GANs)
12
Section 5: The Future of Deep Learning and Advanced Artificial Intelligence

MobileNet with Keras

MobileNet was trained on ImageNet data. We can implement MobileNet using the pre-trained weights for the model by using the Keras application class. Inside the Keras application, you can find a lot of pre-trained models for use. You can go through the documentation of the Keras application at https://keras.io/applications/.

So, let's get started! First, obviously, we will import the required dependencies:

import keras
from keras.preprocessing import image
from keras.applications import imagenet_utils
from keras.models import Model
from keras.applications.mobilenet import preprocess_input

import numpy as np
import argparse
import matplotlib.pyplot as plt

The Keras preprocessing provides a class such as the ImageDataGenerator class which helps to draw batches of images from the dataset. Our next job is to fetch the model weights and graph. The download...