Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Neural Network Programming with TensorFlow

You're reading from   Neural Network Programming with TensorFlow Unleash the power of TensorFlow to train efficient neural networks

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781788390392
Length 274 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Manpreet Singh Ghotra Manpreet Singh Ghotra
Author Profile Icon Manpreet Singh Ghotra
Manpreet Singh Ghotra
Rajdeep Dua Rajdeep Dua
Author Profile Icon Rajdeep Dua
Rajdeep Dua
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Maths for Neural Networks FREE CHAPTER 2. Deep Feedforward Networks 3. Optimization for Neural Networks 4. Convolutional Neural Networks 5. Recurrent Neural Networks 6. Generative Models 7. Deep Belief Networking 8. Autoencoders 9. Research in Neural Networks 10. Getting started with TensorFlow

Sparse autoencoder


In this section, we will look at how adding sparsity to the cost function helps in reducing the cost of training. Most of the code remains the same, but the primary changes are in the way the cost function is calculated.

KL divergence

Let's first try to understand KL divergence, which is used to add sparsity to the cost function.

We can think of a neuron as active (or firing) if a neuron's output value is close to one, and inactive if its output value is close to zero. We would like to constrain the neurons to be inactive most of the time. This discussion assumes a sigmoid activation function. Recall that a(2)j denotes the activation of the hidden unit j in the autoencoder. This notation does not state explicitly what the input x was that led to this activation. We will write a(2)j(x) to denote the activation of the hidden unit when the network is given a specific input x. Further, let

be the average activation of the hidden unit j (averaged over the training set). We would...

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