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
Hands-On Deep Learning Algorithms with Python
Hands-On Deep Learning Algorithms with Python

Hands-On Deep Learning Algorithms with Python: Master deep learning algorithms with extensive math by implementing them using TensorFlow

Arrow left icon
Profile Icon Sudharsan Ravichandiran
Arrow right icon
€8.99 €23.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1 (13 Ratings)
eBook Jul 2019 512 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Sudharsan Ravichandiran
Arrow right icon
€8.99 €23.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1 (13 Ratings)
eBook Jul 2019 512 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Hands-On Deep Learning Algorithms with Python

Introduction to Deep Learning

Deep learning is a subset of machine learning inspired by the neural networks in the human brain. It has been around for a decade, but the reason it is so popular right now is due to the computational advancements and availability of the huge volume of data. With a huge volume of data, deep learning algorithms outperform classic machine learning. It has already been transfiguring and extensively used in several interdisciplinary scientific fields such as computer vision, natural language processing (NLP), speech recognition, and many others.

In this chapter, we will learn about the following topics:

  • Fundamental concepts of deep learning
  • Biological and artificial neurons
  • Artificial neural network and its layers
  • Activation functions
  • Forward and backward propagation in ANN
  • Gradient checking algorithm
  • Building an artificial neural network from scratch...

What is deep learning?

Deep learning is just a modern name for artificial neural networks with many layers. What is deep in deep learning though? It is basically due to the structure of the artificial neural network (ANN). ANN consists of some n number of layers to perform any computation. We can build an ANN with several layers where each layer is responsible for learning the intricate patterns in the data. Due to the computational advancements, we can build a network even with 100s or 1000s of layers deep. Since the ANN uses deep layers to perform learning we call it as deep learning and when ANN uses deep layers to learn we call it as a deep network. We have learned that deep learning is a subset of machine learning. How does deep learning differ from machine learning? What makes deep learning so special and popular?

The success of machine learning lies in the right set of...

Biological and artificial neurons

Before going ahead, first, we will explore what are neurons and how neurons in our brain actually work, and then we will learn about artificial neurons.

A neuron can be defined as the basic computational unit of the human brain. Neurons are the fundamental units of our brain and nervous system. Our brain encompasses approximately 100 billion neurons. Each and every neuron is connected to one another through a structure called a synapse, which is accountable for receiving input from the external environment, sensory organs for sending motor instructions to our muscles, and for performing other activities.

A neuron can also receive inputs from the other neurons through a branchlike structure called a dendrite. These inputs are strengthened or weakened; that is, they are weighted according to their importance and then they are summed together in...

ANN and its layers

While neurons are really cool, we cannot just use a single neuron to perform complex tasks. This is the reason our brain has billions of neurons, stacked in layers, forming a network. Similarly, artificial neurons are arranged in layers. Each and every layer will be connected in such a way that information is passed from one layer to another.

A typical ANN consists of the following layers:

  • Input layer
  • Hidden layer
  • Output layer

Each layer has a collection of neurons, and the neurons in one layer interact with all the neurons in the other layers. However, neurons in the same layer will not interact with one another. This is simply because neurons from the adjacent layers have connections or edges between them; however, neurons in the same layer do not have any connections. We use the term nodes or units to represent the neurons in the artificial neural network...

Exploring activation functions

An activation function, also known as a transfer function, plays a vital role in neural networks. It is used to introduce non-linearity in neural networks. As we learned before, we apply the activation function to the input, which is multiplied by weights and added to the bias, that is, , where z = (input * weights) + bias and is the activation function. If we do not apply the activation function, then a neuron simply resembles the linear regression. The aim of the activation function is to introduce a non-linear transformation to learn the complex underlying patterns in the data.

Now let's look at some of the interesting commonly used activation functions.

The sigmoid function

The sigmoid...

Forward propagation in ANN

In this section, we will see how an ANN learns where neurons are stacked up in layers. The number of layers in a network is equal to the number of hidden layers plus the number of output layers. We don't take the input layer into account when calculating the number of layers in a network. Consider a two-layer neural network with one input layer, , one hidden layer, , and one output layer, , as shown in the following diagram:

Let's consider we have two inputs, and , and we have to predict the output, . Since we have two inputs, the number of neurons in the input layer will be two. We set the number of neurons in the hidden layer to four, and, the number of neurons in the output layer to one. Now, the inputs will be multiplied by weights, and then we add bias and propagate the resultant value to the hidden layer where the activation function...

How does ANN learn?

If the cost or loss is very high, then it means that our network is not predicting the correct output. So, our objective is to minimize the cost function so that our neural network predictions will be better. How can we minimize the cost function? That is, how can we minimize the loss/cost? We learned that the neural network makes predictions using forward propagation. So, if we can change some values in the forward propagation, we can predict the correct output and minimize the loss. But what values can we change in the forward propagation? Obviously, we can't change input and output. We are now left with weights and bias values. Remember that we just initialized weight matrices randomly. Since the weights are random, they are not going to be perfect. Now, we will update these weight matrices ( and ) in such a way that our neural network gives a correct...

Debugging gradient descent with gradient checking

We just learned how gradient descent works and how to code the gradient descent algorithm from scratch for a simple two-layer network. But implementing gradient descent for complex neural networks is not a simple task. Apart from implementing, debugging a gradient descent for complex neural network architecture is again a tedious task. Surprisingly, even with some buggy gradient descent implementations, the network will learn something. However, apparently, it will not perform well compared to the bug-free implementation of gradient descent.

If the model does not give us any errors and learns something even with buggy implementations of the gradient descent algorithm, how can we evaluate and ensure that our implementation is correct? That is why we use the gradient checking algorithm. It will help us to validate our implementation...

Putting it all together

Putting all the concepts we have learned so far together, we will see how to build a neural network from scratch. We will understand how the neural network learns to perform the XOR gate operation. The XOR gate returns 1 only when exactly only one of its inputs is 1, else it returns 0 as shown in the following table:

Building a neural network from scratch

To perform the XOR gate operation, we build a simple two-layer neural network, as shown in the following diagram. As you can see, we have an input layer with two nodes: a hidden layer with five nodes and an output layer comprising one node:

We will understand step-by-step how a neural network learns the XOR logic:

  1. First, import the libraries:
import...

Summary

We started off the chapter by understanding what deep learning is and how it differs from machine learning. Later, we learned how biological and artificial neurons work, and then we explored what is input, hidden, and output layer in the ANN, and also several types of activation functions.

Going ahead, we learned what forward propagation is and how ANN uses forward propagation to predict the output. After this, we learned how ANN uses backpropagation for learning and optimizing. We learned an optimization algorithm called gradient descent that helps the neural network to minimize the loss and make correct predictions. We also learned about gradient checking, a technique that is used to evaluate the gradient descent. At the end of the chapter, we implemented a neural network from scratch to perform the XOR gate operation.

In the next chapter, we will learn about one of...

Questions

Let's evaluate our newly acquired knowledge by answering the following questions:

  1. How does deep learning differ from machine learning?
  2. What does the word deep mean in deep learning?
  3. Why do we use the activation function?
  4. Explain dying ReLU problem.
  5. Define forward propagation.
  6. What is back propagation?
  7. Explain gradient checking.

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Get up to speed with building your own neural networks from scratch
  • Gain insights into the mathematical principles behind deep learning algorithms
  • Implement popular deep learning algorithms such as CNNs, RNNs, and more using TensorFlow

Description

Deep learning is one of the most popular domains in the AI space that allows you to develop multi-layered models of varying complexities. This book introduces you to popular deep learning algorithms—from basic to advanced—and shows you how to implement them from scratch using TensorFlow. Throughout the book, you will gain insights into each algorithm, the mathematical principles involved, and how to implement it in the best possible manner. The book starts by explaining how you can build your own neural networks, followed by introducing you to TensorFlow, the powerful Python-based library for machine learning and deep learning. Moving on, you will get up to speed with gradient descent variants, such as NAG, AMSGrad, AdaDelta, Adam, and Nadam. The book will then provide you with insights into recurrent neural networks (RNNs) and LSTM and how to generate song lyrics with RNN. Next, you will master the math necessary to work with convolutional and capsule networks, widely used for image recognition tasks. You will also learn how machines understand the semantics of words and documents using CBOW, skip-gram, and PV-DM. Finally, you will explore GANs, including InfoGAN and LSGAN, and autoencoders, such as contractive autoencoders and VAE. By the end of this book, you will be equipped with all the skills you need to implement deep learning in your own projects.

Who is this book for?

If you are a machine learning engineer, data scientist, AI developer, or anyone looking to delve into neural networks and deep learning, this book is for you. Those who are completely new to deep learning, but have some experience in machine learning and Python programming will also find the book very helpful.

What you will learn

  • Implement basic-to-advanced deep learning algorithms
  • Master the mathematics behind deep learning algorithms
  • Become familiar with gradient descent and its variants, such as AMSGrad, AdaDelta, Adam, and Nadam
  • Implement recurrent networks, such as RNN, LSTM, GRU, and seq2seq models
  • Understand how machines interpret images using CNN and capsule networks
  • Implement different types of generative adversarial network, such as CGAN, CycleGAN, and StackGAN
  • Explore various types of autoencoder, such as Sparse autoencoders, DAE, CAE, and VAE

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 25, 2019
Length: 512 pages
Edition : 1st
Language : English
ISBN-13 : 9781789344516
Category :
Languages :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jul 25, 2019
Length: 512 pages
Edition : 1st
Language : English
ISBN-13 : 9781789344516
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 91.97
Advanced Deep Learning with Python
€36.99
Hands-On Deep Learning Algorithms with Python
€29.99
Hands-On Deep Learning Architectures with Python
€24.99
Total 91.97 Stars icon
Banner background image

Table of Contents

16 Chapters
Section 1: Getting Started with Deep Learning Chevron down icon Chevron up icon
Introduction to Deep Learning Chevron down icon Chevron up icon
Getting to Know TensorFlow Chevron down icon Chevron up icon
Section 2: Fundamental Deep Learning Algorithms Chevron down icon Chevron up icon
Gradient Descent and Its Variants Chevron down icon Chevron up icon
Generating Song Lyrics Using RNN Chevron down icon Chevron up icon
Improvements to the RNN Chevron down icon Chevron up icon
Demystifying Convolutional Networks Chevron down icon Chevron up icon
Learning Text Representations Chevron down icon Chevron up icon
Section 3: Advanced Deep Learning Algorithms Chevron down icon Chevron up icon
Generating Images Using GANs Chevron down icon Chevron up icon
Learning More about GANs Chevron down icon Chevron up icon
Reconstructing Inputs Using Autoencoders Chevron down icon Chevron up icon
Exploring Few-Shot Learning Algorithms Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1
(13 Ratings)
5 star 61.5%
4 star 15.4%
3 star 0%
2 star 15.4%
1 star 7.7%
Filter icon Filter
Top Reviews

Filter reviews by




Surender m Sep 06, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It’s a great book that’s one should have in their collection. Simple language. Easy to understand with python codes.Great book to start learning.
Amazon Verified review Amazon
Reshma Dec 01, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I completed first chapter. Book so far looks concise, simple and up to the point. I will recommend it to a beginner.
Amazon Verified review Amazon
kalyan reddy k Aug 23, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great material for learning, One should go through this book to get the best out of the Deep learning techniques. Besides theory, one can go through the coding for each technique which helps to understand how things work. GREAT to have one.
Amazon Verified review Amazon
Vikash Jan 01, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Best book for mastering Deep Learning. It will give you in-depth knowledge on Basic to Advance Deep Learning algorithm with mathematics behind each algorithm. Each page made you hungry to go further reading. I recommend it to everyone who wanted to learn Deep Learning from Basic to advance level. Best book ever on Deep Learning.Thanks Sudharsan for writing this amazing book on Deep Learning.
Amazon Verified review Amazon
Amazon Customer Sep 05, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Literally it is the best book on Deep Learning I have ever read. Never have I thought, someone could explain DL in such a simple way that too by making all the complex math very simple. After reading this book, I am literally in love with math.This book is for all sets of audiences. Interested in DL applications? Or wanna learn DL with detailed math or wanna learn DL intuitively? This has covered everything from basic algorithms to advanced algorithms like stack gan, cycle gan, VAE, transformer and more that too with hands-on application.Loved it! Loved it! Loved it! very much.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.