Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python Deep Learning Cookbook

You're reading from  Python Deep Learning Cookbook

Product type Book
Published in Oct 2017
Publisher Packt
ISBN-13 9781787125193
Pages 330 pages
Edition 1st Edition
Languages
Author (1):
Indra den Bakker Indra den Bakker
Profile icon Indra den Bakker
Toc

Table of Contents (21) Chapters close

Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Programming Environments, GPU Computing, Cloud Solutions, and Deep Learning Frameworks 2. Feed-Forward Neural Networks 3. Convolutional Neural Networks 4. Recurrent Neural Networks 5. Reinforcement Learning 6. Generative Adversarial Networks 7. Computer Vision 8. Natural Language Processing 9. Speech Recognition and Video Analysis 10. Time Series and Structured Data 11. Game Playing Agents and Robotics 12. Hyperparameter Selection, Tuning, and Neural Network Learning 13. Network Internals 14. Pretrained Models

Implementing an autoencoder


For autoencoders, we use a network architecture, as shown in the following figure. In the first couple of layers, we decrease the number of hidden units. Halfway, we start increasing the number of hidden units again until the number of hidden units is the same as the number of input variables. The middle hidden layer can be seen as an encoded variant of the inputs, where the output determines the quality of the encoded variant:

Figure 2.13: Autoencoder network with three hidden layers, with m < n

In the next recipe, we will implement an in Keras to decode Street View House Numbers (SVHN) from 32 x 32 images to 32 floating numbers. We can determine the quality of the encoder by decoding back to 32 x 32 and comparing the images.

How to do it...

  1. Import the necessary libraries with the following code:
import numpy as np
from matplotlib import pyplot as plt
import scipy.io

from keras.models import Sequential
from keras.layers.core import Dense
from keras.optimizers...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime