Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Deep Learning for Beginners

You're reading from   Deep Learning for Beginners A beginner's guide to getting up and running with deep learning from scratch using Python

Arrow left icon
Product type Paperback
Published in Sep 2020
Publisher Packt
ISBN-13 9781838640859
Length 432 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Pablo Rivas Pablo Rivas
Author Profile Icon Pablo Rivas
Pablo Rivas
Dr. Pablo Rivas Dr. Pablo Rivas
Author Profile Icon Dr. Pablo Rivas
Dr. Pablo Rivas
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Getting Up to Speed
2. Introduction to Machine Learning FREE CHAPTER 3. Setup and Introduction to Deep Learning Frameworks 4. Preparing Data 5. Learning from Data 6. Training a Single Neuron 7. Training Multiple Layers of Neurons 8. Section 2: Unsupervised Deep Learning
9. Autoencoders 10. Deep Autoencoders 11. Variational Autoencoders 12. Restricted Boltzmann Machines 13. Section 3: Supervised Deep Learning
14. Deep and Wide Neural Networks 15. Convolutional Neural Networks 16. Recurrent Neural Networks 17. Generative Adversarial Networks 18. Final Remarks on the Future of Deep Learning 19. Other Books You May Enjoy

Comparing RBMs and AEs

Now that we have seen how RBMs perform, a comparison with AEs is in order. To make this comparison fair, we can propose the closest configuration to an RBM that an AE can have; that is, we will have the same number of hidden units (neurons in the encoder layer) and the same number of neurons in the visible layer (the decoder layer), as shown in Figure 10.6:

Figure 10.6 – AE configuration that's comparable to RBM

We can model and train our AE using the tools we covered in Chapter 7, Autoencoders, as follows:

from tensorflow.keras.layers import Input, Dense
from tensorflow.keras.models import Model

inpt_dim = 28*28 # 784 dimensions
ltnt_dim = 100 # 100 components

inpt_vec = Input(shape=(inpt_dim,))
encoder = Dense(ltnt_dim, activation='sigmoid') (inpt_vec)
latent_ncdr = Model(inpt_vec, encoder)
decoder = Dense(inpt_dim, activation='sigmoid') (encoder)
autoencoder = Model(inpt_vec, decoder)

autoencoder.compile(loss='binary_crossentropy...
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 $19.99/month. Cancel anytime
Banner background image