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
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Deep Learning for Beginners
Deep Learning for Beginners

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

Arrow left icon
Profile Icon Dr. Pablo Rivas
Arrow right icon
₹3425.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (3 Ratings)
Paperback Sep 2020 432 pages 1st Edition
eBook
₹999.99 ₹2740.99
Paperback
₹3425.99
Arrow left icon
Profile Icon Dr. Pablo Rivas
Arrow right icon
₹3425.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (3 Ratings)
Paperback Sep 2020 432 pages 1st Edition
eBook
₹999.99 ₹2740.99
Paperback
₹3425.99
eBook
₹999.99 ₹2740.99
Paperback
₹3425.99

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

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

Deep Learning for Beginners

Introduction to Machine Learning

You have probably heard the term Machine Learning (ML) or Artificial Intelligence (AI) frequently in recent years, especially Deep Learning (DL). It may be the reason you decided to invest in this book and get to know more. Given some new, exciting developments in the area of neural networks, DL has come to be a hot area in ML. Today, it is difficult to imagine a world without quick text translation between languages, or without fast song identification. These, and many other things, are just the tip of the iceberg when it comes to the potential of DL to change your world. When you finish this book, we hope you will join the bus and ride along with amazing new applications and projects based on DL.

This chapter briefly introduces the field of ML and how it is used to solve common problems. Throughout this chapter, you will be driven to understand the basic concepts of ML, the research questions addressed, and their significance.

The following topics will be covered in this chapter:

  • Diving into the ML ecosystem
  • Training ML algorithms from data
  • Introducing deep learning
  • Why is deep learning important today?

Diving into the ML ecosystem

From the typical ML application process depicted in Figure 1.1, you can see that ML has a broad range of applications. However, ML algorithms are only a small part of a bigger ecosystem with a lot of moving parts, and yet ML is transforming lives around the world today:

Figure 1.1 - ML ecosystem. ML interacts with the world through several stages of data manipulation and interpretation to achieve an overall system integration

Deployed ML applications usually start with a process of data collection that uses sensors of different types, such as cameras, lasers, spectroscopes, or other types of direct access to data, including local and remote databases, big or small. In the simplest of cases, input can be gathered through a computer keyboard or smartphone screen taps. At this stage, the data collected or sensed is considered to be raw data.

Raw data is usually preprocessed before presenting it to an ML model. Raw data is rarely the actual input to ML algorithms, unless the ML model is meant to find a rich representation of the raw data, and later be used as input to another ML algorithm. In other words, there are some ML algorithms that are specifically used as preprocessing agents and they are not at all related to a main ML model that will classify or regress on the preprocessed data. In a general sense, this data preprocessing stage aims to convert raw data into arrays or matrices with specific data types. Some popular preprocessing strategies include the following:

  • Word-to-vector conversions, for example, using GloVe or Word2Vec
  • Sequence-to-vector or sequence-to-matrix strategies
  • Value range normalization, for example, (0, 255) to (0.0, 1.0)
  • Statistical value normalization, for example, to have zero mean and unit variance

Once these preprocessing measures take place, most ML algorithms can use the data. However, it must be noted that the preprocessing stage is not trivial, it requires advanced knowledge and skills with respect to operating systems and sometimes even electronics. In a general sense, a real ML application has a long pipeline touching different aspects of computer science and engineering.

The processed data is what you will usually see in books like the one you are reading right now. The reason is that we need to focus on deep learning instead of data processing. If you wish to be more knowledgeable in this area, you could read data science materials such as Ojeda, T. et.al. 2014 or Kane, F. 2017.

Mathematically speaking, the processed data as a whole is referred to using the uppercase, bold font, letter X, which has N rows (or data points). If we want to refer to the specific i-th element (or row) of the dataset, we would do that by writing: Xi. The dataset will have d columns and they are usually called features. One way to think about the features is as dimensions. For example, if the dataset has two features, height and weight, then you could represent the entire dataset using a two-dimensional plot. The first dimension, x1, (height) can be the horizontal axis, while the second dimension, x2, (weight) can be the vertical axis, as depicted in Figure 1.2:

Figure 1.2 - Sample two-dimensional data

During production, when the data is presented to an ML algorithm, a series of tensor products and additions will be executed. Such vectorial operations are usually transformed or normalized using non-linear functions. This is then followed by more products and additions, more non-linear transformations, temporary storage of intermediate values, and finally producing the desired output that corresponds to the input. For now, you can think of this process as an ML black box that will be revealed as you continue reading.

The output that the ML produces in correspondence to the input usually requires some type of interpretation, for example, if the output is a vector of probabilities of objects being classified to belong to a group or to another, then that may need to be interpreted. You may need to know how low the probabilities are in order to account for uncertainty, or you may need to know how different are the probabilities to account for even more uncertainty. The output processing serves as the connecting factor between ML and the decision-making world through the use of business rules. These rules can be, for example, if-then rules such as, "If the predicted probability of the maximum is twice as large as the second maximum, then issue a prediction; otherwise, do not proceed to make a decision." Or they can be formula-based rules or more complex systems of equations.

Finally, in the decision-making stage, the ML algorithm is ready to interact with the world by turning on a light bulb through an actuator, or to buy stock if the prediction is not uncertain, by alerting a manager that the company will run out of inventory in three days and they need to buy more items, or by sending an audio message to a smartphone speaker saying, "Here is the route to the movie theater" and opening a maps application through an application programming interface (API) call or operating system (OS) commands.

This is a broad overview of the world of ML systems when they are in production. However, this assumes that the ML algorithm is properly trained and tested, which is the easy part, trust me. At the end of the book, you will be skilled in training highly complex, deep learning algorithms but, for now, let us introduce the generic training process.

Training ML algorithms from data

A typical preprocessed dataset is formally defined as follows:

Where y is the desired output corresponding to the input vector x. So, the motivation of ML is to use the data to find linear and non-linear transformations over x using highly complex tensor (vector) multiplications and additions, or to simply find ways to measure similarities or distances among data points, with the ultimate purpose of predicting y given x.

A common way of thinking about this is that we want to approximate some unknown function over x:

Where w is an unknown vector that facilitates the transformation of x along with b. This formulation is very basic, linear, and is simply an illustration of what a simple learning model would look like. In this simple case, the ML algorithms revolve around finding the best w and b that yields the closest (if not perfect) approximation to y, the desired output. Very simple algorithms such as the perceptron (Rosenblatt, F. 1958) try different values for w and b using past mistakes in the choices of w and b to make the next selection in proportion to the mistakes made.

A combination of perceptron-like models that look at the same input, intuitively, turned out to be better than single ones. Later, people realized that having them stacked may be the next logical step leading to multilayer perceptrons, but the problem was that the learning process was rather complicated for people in the 1970s. These kinds of multilayered systems were analog to brain neurons, which is the reason we call them neural networks today. With some interesting discoveries in ML, new specific kinds of neural networks and algorithms were created known as deep learning.

Introducing deep learning

While a more detailed discussion of learning algorithms will be addressed in Chapter 4, Learning from Data, in this section, we will deal with the fundamental concept of a neural network and the developments that led to deep learning.

The model of a neuron

The human brain has input connections from other neurons (synapses) that receive stimuli in the form of electric charges, and then has a nucleus that depends on how the input stimulates the neuron that can trigger the neuron's activation. At the end of the neuron, the output signal is propagated to other neurons through dendrites, thus forming a network of neurons.

The analogy of the human neuron is depicted in Figure 1.3, where the input is represented with the vector x, the activation of the neuron is given by some function z(.), and the output is y. The parameters of the neuron are w and b:

Figure 1.3 - The basic model of a neuron

The trainable parameters of a neuron are w and b, and they are unknown. Thus, we can use training data to determine these parameters using some learning strategy. From the picture, x1 multiplies w1, then x2 multiplies w2, and b is multiplied by 1; all these products are added, which can be simplified as follows:

The activation function operates as a way to ensure the output is within the desired output range. Let's say that we want a simple linear activation, then the function z(.) is non-existing or can be bypassed, as follows:

This is usually the case when we want to solve a regression problem and the output data can have a range from -∞ to +∞. However, we may want to train the neuron to determine whether a vector x belongs to one of two classes, say -1 and +1. Then we would be better suited using a function called a sign activation:

Where the sign(.) function is denoted as follows:

There are many other activation functions, but we will introduce those later on. For now, we will briefly show one of the simplest learning algorithms, the perceptron learning algorithm (PLA).

The perceptron learning algorithm

The PLA begins from the assumption that you want to classify data, X, into two different groups, the positive group (+) and the negative group (-). It will find some w and b by training to predict the corresponding correct labels y. The PLA uses the sign( . ) function as the activation. Here are the steps that the PLA follows:

  1. Initialize w to zeros, and iteration counter t = 0
  2. While there are any incorrectly classified examples:
  • Pick an incorrectly classified example, call it x*, whose true label is y*
  • Update w as follows: wt+1 = wt + y*x*
  • Increase iteration counter t++ and repeat

Notice that, for the PLA to work as we want, we have to make an adjustment. What we want is for to be implied in the expression . The only way this could work is if we set and . The previous rule seeks w, which implies the search for b.

To illustrate the PLA, consider the case of the following linearly separable dataset:

A linearly separable dataset is one whose data points are sufficiently apart such that at least one hypothetical line exists that can be used to separate the data groups into two. Having a linearly separable dataset is the dream of all ML scientists, but it is seldom the case that we will find such datasets naturally. In further chapters, we will see that neural networks transform the data into a new feature space where such a line may exist.

This two-dimensional dataset was produced at random using Python tools that we will discuss later on. For now, it should be self-evident that you can draw a line between the two groups and divide them.

Following the steps outlined previously, the PLA can find a solution, that is, a separating line that satisfies the training data target outputs completely in only four iterations in this particular case. The plots after each update are depicted in the following plots with the corresponding line found at every update:

At iteration zero, all 100 points are misclassified, but after randomly choosing one misclassified point to make the first update, the new line only misses four points:

After the second update, the line only misses one data point:

Finally, after update number three, all data points are correctly classified. This is just to show that a simple learning algorithm can successfully learn from data. Also, the perceptron model led to much more complicated models such as a neural network. We will now introduce the concept of a shallow network and its basic complexities.

Shallow networks

A neural network consists of multiple networks connected in different layers. In contrast, a perceptron has only one neuron and its architecture consists of an input layer and an output layer. In neural networks, there are additional layers between the input and output layer, as shown in Figure 1.4, and they are known as hidden layers:

Figure 1.4 - Example of a shallow neural network

The example in the figure shows a neural network that has a hidden layer with eight neurons in it. The input size is 10-dimensional, and the output layer has four dimensions (four neurons). This intermediate layer can have as many neurons as your system can handle during training, but it is usually a good idea to keep things to a reasonable number of neurons.

If this is your first time using neural networks, it is recommended that your hidden layer size, that is, the number of neurons, is greater than or equal to the input layer, and less than or equal to the output size. However, although this is good advice for absolute beginners, this is not an absolute scientific fact since finding the optimal number of neurons in neural networks is an art, rather than a science, and it is usually determined through a great deal of experimentation.

Neural networks can solve more difficult problems than without a network, for example, with a single neural unit such as the perceptron. This must feel intuitive and must be easy to conceive. A neural network can solve problems including and beyond those that are linearly separable. For linearly separable problems, we can use both the perceptron model and a neural network. However, for more complex and non-linearly separable problems, the perceptron cannot offer a high-quality solution, while a neural network does.

For example, if we consider the sample two-class dataset and we bring the data groups closer together, the perceptron will fail to terminate with a solution and some other strategy can be used to stop it from going forever. Or, we can switch to a neural network and train it to find the best solution it can possibly find. Figure 1.5 shows an example of training a neural network with 100 neurons in the hidden layer over a two-class dataset that is not linearly separable:

Figure 1.5 - Non-separable data and a non-linear solution using a neural network with 100 neurons in the hidden layer

This neural network has 100 neurons in the hidden layer. This was a choice done by experimentation and you will learn strategies on how to find such instances in further chapters. However, before we go any further, there are two new terms introduced that require further explanation: non-separable data and non-linear models, which are defined as follows:

  • Non-separable data is such that there is no line that can separate groups of data (or classes) into two groups.
  • Non-linear models, or solutions, are those that naturally and commonly occur when the best solution to a classification problem is not a line. For example, it can be some curve described by some polynomial of any degree greater than one. For an example, see Figure 1.5.

A non-linear model is usually what we will be working with throughout this book, and the reason is that this is most likely what you will encounter out there in the real world. Also, it is non-linear, in a way, because the problem is non-separable. To achieve this non-linear solution, the neural network model goes through the following mathematical operations.

The input-to-hidden layer

In a neural network, the input vector x is connected to a number of neurons through weights w for each neuron, which can be now thought of as a number of weight vectors forming a matrix W. The matrix W has as many columns as neurons as the layer has, and as many rows as the number of features (or dimensions) x has. Thus, the output of the hidden layer can be thought of as the following vector:

Where b is a vector of biases, whose elements correspond to one neural unit, and the size of h is proportional to the number of hidden units. For example, eight neurons in Figure 1.4, and 100 neurons in Figure 1.5. However, the activation function z(.) does not have to be the sign(.) function, in fact, it usually never is. Instead, most people use functions that are easily differentiable.

A differentiable activation function is one that has a mathematical derivative that can be computed with traditional numerical methods or that is clearly defined. The opposite would be a function that does not have a defined derivative, it does not exist, or is nearly impossible to calculate.

The hidden-to-hidden layer

In a neural network, we could have more than one single hidden layer, and we will work with this kind a lot in this book. In such case, the matrix W can be expressed as a three-dimensional matrix that will have as many elements in the third dimension and as many hidden layers as the network has. In the case of the i-th layer, we will refer to that matrix as Wi for convenience.

Therefore, we can refer to the output of the i-th hidden layer as follows:

For i = 2, 3, ..., k-1, where k is the total number of layers, and the case of h1 is computed with the equation given for the first layer (see previous section), which uses x directly, and does not go all the way to the last layer, hk, because that is computed as discussed next.

The hidden-to-output layer

The overall output of the network is the output at the last layer:

Here, the last activation function is usually different from the hidden layer activations. The activation function in the last layer (output) traditionally depends on the type of problem we are trying to solve. For example, if we want to solve a regression problem, we would use a linear function, or sigmoid activations for classification problems. We will discuss those later on. For now, it should be evident that the perceptron algorithm will no longer work in the training phase.

While the learning still has to be in terms of the mistakes the neural network makes, the adjustments cannot be in direct proportion to the data point that is incorrectly classified or predicted. The reason is that the neurons in the last layer are responsible for making the predictions, but they depend on a previous layer, and those may depend on more previous layers, and when making adjustments to W and b, the adjustment has to be made differently for each neuron.

One approach to do this is to apply gradient descent techniques on the neural network. There are many of these techniques and we will discuss the most popular of these in further chapters. In general, a gradient descent algorithm is one that uses the notion that, if you take the derivative of a function and that reaches a value of zero, then you have found the maximum (or minimum) value you can get for the set of parameters on which you are taking the derivatives. For the case of scalars, we call them derivatives, but for vectors or matrices (W, b), we call them gradients.

The function we can use is called a loss function.

A loss function is usually one that is differentiable so that we can calculate its gradient using some gradient descent algorithm.

We can define a loss function, for example, as follows:

This loss is known as the mean squared error (MSE); it is meant to measure how different the target output y is from the predicted output in the output layer hk in terms of the square of its elements, and averaged. This is a good loss because it is differentiable and it is easy to compute.

A neural network such as this introduced a great number of possibilities, but relied heavily on a gradient descent technique for learning them called backpropagation (Hecht-Nielsen, R. 1992). Rather than explaining backpropagation here (we will reserve that for later), we rather have to remark that it changed the world of ML, but did not make much progress for a number of years because it had some practical limitations and the solutions to these paved the way for deep learning.

Deep networks

On March 27, 2019, an announcement was published by the ACM saying that three computer scientists were awarded the Nobel Prize in computing, that is, the ACM Turing Award, for their achievements in deep learning. Their names are Yoshua Bengio, Yann LeCun, and Geoffrey Hinton; all are very accomplished scientists. One of their major contributions was in the learning algorithm known as backpropagation.

In the official communication, the ACM wrote the following about Dr. Hinton and one of his seminal papers (Rumelhart, D. E. 1985):

In a 1986 paper, “Learning Internal Representations by Error Propagation,” co-authored with David Rumelhart and Ronald Williams, Hinton demonstrated that the backpropagation algorithm allowed neural nets to discover their own internal representations of data, making it possible to use neural nets to solve problems that had previously been thought to be beyond their reach. The backpropagation algorithm is standard in most neural networks today.

Similarly, they wrote the following about Dr. LeCun's paper (LeCun, Y., et.al., 1998):

LeCun proposed an early version of the backpropagation algorithm (backprop), and gave a clean derivation of it based on variational principles. His work to speed up backpropagation algorithms included describing two simple methods to accelerate learning time.

Dr. Hinton was able to show that there was a way to minimize a loss function in neural networks using biologically inspired algorithms such as the backward and forward adjustment of connections by modifying its importance for particular neurons. Usually, backpropagation is related to feed-forward neural networks, while backward-forward propagation is related to Restricted Boltzmann Machines (covered in Chapter 10, Restricted Boltzmann Machines).

A feed-forward neural network is one whose input is pipelined directly toward the output layer through intermediate layers that have no backward connections, as shown in Figure 1.4, and we will talk about these all the time in this book.

It is usually safe to assume that, unless you are told otherwise, all neural networks have a feed-forward architecture. Most of this book will talk about deep neural networks and the great majority are feed-forward-like, with the exception of Restricted Boltzmann Machines or recurrent neural networks, for example.

Backpropagation enabled people to train neural networks in a way that was never seen before; however, people had problems training neural networks on large datasets, and on larger (deeper) architectures. If you go ahead and look at neural network papers in the late '80s and early '90s, you will notice that architectures were small in size; networks usually had no more than two or three layers, and the number of neurons usually did not exceed the order of hundreds. These are (today) known as shallow neural networks.

The major problems were with convergence time for larger datasets, and convergence time for deeper architectures. Dr. LeCun's contributions were precisely in this area as he envisioned different ways to speed up the training process. Other advances such as vector (tensor) computations over graphics processing units (GPUs) increased training speeds dramatically.

Thus, over the last few years, we have seen the rise of deep learning, that is, the ability to train deeper neural networks, with more than three or four layers, in fact with tens and hundreds of layers. Further, we have a wide variety of architectures that can accomplish things that we were not able in the last decade.

The deep network shown in Figure 1.6 would have been impossible to train 30 years ago, and it is not that deep anyway:

Figure 1.6 - A deep and fully connected feed-forward neural network with eight layers
In this book, we will consider a deep neural network any network that has more than three or four layers overall. However, there is no standard definition as to exactly how deep is considered deep out there. Also, you need to consider that what we consider deep today, at the time of writing this book in 2020, will probably not be considered deep in 20 or 30 years from now.

Regardless of the future of DL, let us now discuss what makes DL so important today.

Why is deep learning important today?

Today, we enjoy the benefits of algorithms and strategies that we did not have 20 or 30 years ago, which enable us to have amazing applications that are changing lives. Allow me to summarize some of the great and important things about deep learning today:

  • Training in mini-batches: This strategy allows us today to have very large datasets and train a deep learning model little by little. In the past, we would have to load the entire dataset into memory, making it computationally impossible for some large datasets. Today, yes, it may take a little longer, but we at least can actually perform training on finite time.
  • Novel activation functions: Rectified linear units (ReLUs), for example, are a relatively new kind of activation that solved many of the problems with large-scale training with backpropagation strategies. These new activations enable training algorithms to converge on deep architectures when, in the past, we would get stuck on non-converging training sessions that would end up having exploding or vanishing gradients.
  • Novel neural network architectures: Convolutional or recurrent networks, for example, have been transforming the world by opening the possibilities of things we can do with neural networks. Convolutional networks are widely applied in computer vision applications or other areas in which the convolution operation is a natural thing to do, for example, multi-dimensional signal or audio analysis. Recurrent neural networks with memory are widely used to analyze sequences of text, thus enabling us to have networks that understand words, sentences, and paragraphs, and we can use them to translate between languages, and many more things.
  • Interesting loss functions: These losses play an interesting role in deep learning because, in the past, we only used the same standard losses over and over again; losses such as the MSE. Today, we can minimize the MSE and, at the same time, minimize the norm of the weights or the output of some neurons, which leads to sparser weights and solutions that, in turn, make the produced model much more efficient when it is deployed into production.
  • Novel strategies resembling biology: Things such as missing or dropping connections between neurons, rather than having them fully connected all the time, is more realistic, or comparable to biological neural network design. Also, dropping or removing neurons altogether is a new strategy that can push some neurons to excel when others are removed, learning richer representations, while at the same time reducing the computations during training and when deployed. The sharing of parameters between different and specialized neural networks also has proven to be interesting and effective today.
  • Adversarial training: Making a neural network compete against another network whose sole purpose is to generate fraudulent, noisy, and confusing data points trying to make the network fail has proven to be an excellent strategy for networks to learn better from the data and be robust against noisy environments when deployed into production.

There are many other interesting facts and points that make deep learning an exciting area and justify the writing of this book. I hope you are as excited as we all are and begin reading this book knowing that we are going to code some of the most exciting and incredible neural networks of our time. Our ultimate purpose will be to make deep neural networks that can generalize.

Generalization is the ability of a neural network to correctly make predictions on data that has never been seen before. This is the ultimate purpose of all machine and deep learning practitioners, and requires a great deal of skill and knowledge of the data.

Summary

This introductory chapter presented an overview of ML. It introduced the motivation behind ML and the terminology that is commonly used in the field. It also introduced deep learning and how it fits in the realm of artificial intelligence. At this point, you should feel confident that you know enough about what a neural network is to be curious about how big it can be. You should also feel very intrigued about the area of deep learning and all the new things that are coming out every week.

At this point, you must be a bit anxious to begin your deep learning coding journey; for that reason, the next logical step is to go to Chapter 2, Setup and Introduction to Deep Learning Frameworks. In this chapter, you will get ready for the action by setting up your system and making sure you have access to the resources you will need to be a successful deep learning practitioner. But before you go there, please try to quiz yourself with the following questions.

Questions and answers

  1. Can a perceptron and/or a neural network solve the problem of classifying data that is linearly separable?

Yes, both can.

  1. Can a perceptron and/or a neural network solve the problem of classifying data that is non-separable?

Yes, both can. However, the perceptron will go on forever unless we specify a stopping condition such as a maximum number of iterations (updates), or stopping if the number of misclassified points does not decrease after a number of iterations.

  1. What are the changes in the ML filed that have enabled us to have deep learning today?

(A) backpropagation algorithms, batch training, ReLUs, and so on;

(B) computing power, GPUs, cloud, and so on.

  1. Why is generalization a good thing?

Because deep neural networks are most useful when they can function as expected when they are given data that they have not seen before, that is, data on which they have not been trained.

References

  • Hecht-Nielsen, R. (1992). Theory of the backpropagation neural network. In Neural networks for perception (pp. 65-93). Academic Press.
  • Kane, F. (2017). Hands-On Data Science and Python ML. Packt Publishing Ltd.
  • LeCun, Y., Bottou, L., Orr, G., and Muller, K. (1998). Efficient backprop in neural networks: Tricks of the trade (Orr, G. and Müller, K., eds.). Lecture Notes in Computer Science, 1524(98), 111.
  • Ojeda, T., Murphy, S. P., Bengfort, B., and Dasgupta, A. (2014). Practical Data Science Cookbook. Packt Publishing Ltd.
  • Rosenblatt, F. (1958). The perceptron: a probabilistic model for information storage and organization in the brain. Psychological Review, 65(6), 386.
  • Rumelhart, D. E., Hinton, G. E., and Williams, R. J. (1985). Learning internal representations by error propagation (No. ICS-8506). California Univ San Diego La Jolla Inst for Cognitive Science.
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the fundamental machine learning concepts useful in deep learning
  • Learn the underlying mathematical concepts as you implement deep learning models from scratch
  • Explore easy-to-understand examples and use cases that will help you build a solid foundation in DL

Description

With information on the web exponentially increasing, it has become more difficult than ever to navigate through everything to find reliable content that will help you get started with deep learning. This book is designed to help you if you're a beginner looking to work on deep learning and build deep learning models from scratch, and you already have the basic mathematical and programming knowledge required to get started. The book begins with a basic overview of machine learning, guiding you through setting up popular Python frameworks. You will also understand how to prepare data by cleaning and preprocessing it for deep learning, and gradually go on to explore neural networks. A dedicated section will give you insights into the working of neural networks by helping you get hands-on with training single and multiple layers of neurons. Later, you will cover popular neural network architectures such as CNNs, RNNs, AEs, VAEs, and GANs with the help of simple examples, and learn how to build models from scratch. At the end of each chapter, you will find a question and answer section to help you test what you've learned through the course of the book. By the end of this book, you'll be well-versed with deep learning concepts and have the knowledge you need to use specific algorithms with various tools for different tasks.

Who is this book for?

This book is for aspiring data scientists and deep learning engineers who want to get started with the fundamentals of deep learning and neural networks. Although no prior knowledge of deep learning or machine learning is required, familiarity with linear algebra and Python programming is necessary to get started.

What you will learn

  • Implement recurrent neural networks (RNNs) and long short-term memory (LSTM) for image classification and natural language processing tasks
  • Explore the role of convolutional neural networks (CNNs) in computer vision and signal processing
  • Discover the ethical implications of deep learning modeling
  • Understand the mathematical terminology associated with deep learning
  • Code a generative adversarial network (GAN) and a variational autoencoder (VAE) to generate images from a learned latent space
  • Implement visualization techniques to compare AEs and VAEs
Estimated delivery fee Deliver to India

Premium delivery 5 - 8 business days

₹630.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 18, 2020
Length: 432 pages
Edition : 1st
Language : English
ISBN-13 : 9781838640859
Category :
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
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
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to India

Premium delivery 5 - 8 business days

₹630.95
(Includes tracking information)

Product Details

Publication date : Sep 18, 2020
Length: 432 pages
Edition : 1st
Language : English
ISBN-13 : 9781838640859
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
₹800 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
₹4500 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 ₹400 each
Feature tick icon Exclusive print discounts
₹5000 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 ₹400 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 10,277.97
Artificial Intelligence with Python Cookbook
₹3425.99
Deep Learning for Beginners
₹3425.99
Hands-On Mathematics for Deep Learning
₹3425.99
Total 10,277.97 Stars icon

Table of Contents

19 Chapters
Section 1: Getting Up to Speed Chevron down icon Chevron up icon
Introduction to Machine Learning Chevron down icon Chevron up icon
Setup and Introduction to Deep Learning Frameworks Chevron down icon Chevron up icon
Preparing Data Chevron down icon Chevron up icon
Learning from Data Chevron down icon Chevron up icon
Training a Single Neuron Chevron down icon Chevron up icon
Training Multiple Layers of Neurons Chevron down icon Chevron up icon
Section 2: Unsupervised Deep Learning Chevron down icon Chevron up icon
Autoencoders Chevron down icon Chevron up icon
Deep Autoencoders Chevron down icon Chevron up icon
Variational Autoencoders Chevron down icon Chevron up icon
Restricted Boltzmann Machines Chevron down icon Chevron up icon
Section 3: Supervised Deep Learning Chevron down icon Chevron up icon
Deep and Wide Neural Networks Chevron down icon Chevron up icon
Convolutional Neural Networks Chevron down icon Chevron up icon
Recurrent Neural Networks Chevron down icon Chevron up icon
Generative Adversarial Networks Chevron down icon Chevron up icon
Final Remarks on the Future of Deep Learning Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(3 Ratings)
5 star 33.3%
4 star 66.7%
3 star 0%
2 star 0%
1 star 0%
Damian Valles Nov 27, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a great introduction book by Pablo Rivas to Deep Learning concepts. The book provides great fundamental concepts that are flexible to Sciences and Engineering domains. Also, all proceedings are donated to Latinx in AI! #deeplearning #ai
Amazon Verified review Amazon
Rahul Gupta Feb 19, 2021
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
“Deep Learning for Beginners” by Dr. Pablo Rivas offers a great beginner's guide to getting up and running with deep learning from scratch using Python. It provides step-by-step guided instructions with code and examples explaining basic concepts with practical examples the theory and concepts of Deep Learning in diverse fields such as computer vision, natural language processing, learning representations etc. The book is organized to provide gradual transition between supervised and unsupervised models. Google Colabs, the free website, has been used to provide deep learning tools and libraries accessible to anyone enabling them to run the code on the cloud.Chapter 1, Introduction to Machine Learning, gives an overview of machine learning and introduces the motivation behind machine learning and the commonly used terminologies. It also introduces deep learning and how it fits in the realm of artificial intelligence.Chapter 2, Setup and Introduction to Deep Learning Frameworks, explains the process of setting up TensorFlow and Keras and their usefulness in deep learning.Chapter 3, Preparing Data, introduces the main concepts behind data processing for Deep Learning. It covers essential concepts of data formatting that are categorical or real-valued, as well as techniques for augmenting data or reducing the data dimensions.Chapter 4, Learning from Data, introduces elementary concepts of the theory of deep learning, including measuring performance on regression and classification as well as the identification of underfitting and overfitting and optimizing hyperparameters.Chapter 5, Training a Single Neuron, introduces the concept of a single neuron and the perceptron model, the key to understanding basic neural models that learn from data and explains the problem of non-linearly separable data.Chapter 6, Training Multiple Layers of Neurons, covers deep learning using the multi-layer perceptron (MLP) algorithm, such as gradient descent techniques for error minimization, and hyperparameter optimization.Chapter 7, Autoencoders, describes the AE model by explaining the necessity of both encoding and decoding layers, the loss functions associated with the autoencoder problem and applies it to the dimensionality reduction problem and data visualization.Chapter 8, Deep Autoencoders, introduces the idea of deep belief networks and the significance of deep unsupervised learning. It explains the concepts by introducing deep AEs and contrasting them with shallow AEs.Chapter 9, Variational Autoencoders, covers the principles behind generative models in the unsupervised deep learning field and their importance in the production of robust models free from noise and demonstrates as to why the VAE is a better alternative to a deep AE when working with perturbed data.Chapter 10, Restricted Boltzmann Machines, covers deep belief models by presenting RBMs. The backward-forward nature of RBMs is introduced and contrasted with the forward-only nature of AEs. The chapter compares RBMs and AEs on the problem of data dimensionality reduction using visual representations of the reduced data.Chapter 11, Deep and Wide Neural Networks, explains the difference in performance and complexities of deep versus wide neural networks and introduces the concept of dense networks and sparse networks in terms of the connections between neurons.Chapter 12, Convolutional Neural Networks, introduces CNNs, starting with the convolution operation and moving towards ensemble layers of convolutional operations aiming to learn and apply data filters how to visualize the learned filters.Chapter 13, Recurrent Neural Networks, presents the concepts of recurrent networks, exposing their shortcomings to justify the existence and success of long short-term memory (LSTM) models. Sequential models are explored with applications for image processing and natural language processing.
Amazon Verified review Amazon
AT Mar 24, 2021
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Disclaimer: The publisher asked me to review this book & gave me a review a copy. I promise to give my honest opinion about this book.This book covers all fundamentals of ML ecosystem with hands on example codes. It guides you to set up different ML frameworks. You will understand the concepts of data cleansing & preprocessing, basic ML algorithms, tuning hyper parameters, model evaluation. It covers great details on neural network architectures like CNN, RNN, AE, VAE, and GANs. After reading this, you will have pretty good idea about ML concepts and should be able to train some ML model by yourself.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
Modal Close icon
Modal Close icon