Get startedGet started for free

Deep learning

1. Deep learning

Welcome back! My name is Sara and I will be guiding you through this chapter where we'll cover some more advanced topics in machine learning. Let's start with deep learning.

2. What is deep learning?

So what is deep learning? Deep learning uses an algorithm called neural networks, which are loosely inspired by biological neural networks in human brains. Neurons, also sometimes called nodes, are the basic unit of neural networks. Deep learning is a special type of machine learning that can solve more complex problems but it requires much more data than traditional machine learning. It is best used in cases where the inputs are less structured, such as large amounts of text or images.

3. Predicting box office revenue

So how does it work? Imagine you work for a Hollywood studio and you want to predict box office revenue for an upcoming movie. You have access to a dataset that maps past movies' box office revenue to their production budget. As you can see, a straight line can be drawn through the data points, showing that as budget goes up, box office revenue increases. This red line is an example of a prediction from a simple model. The neural network that would accomplish this can be drawn like this. Where budget is passed as input to a neuron that calculates the red curve, and outputs box office revenue.

4. Predicting box office revenue

Suppose that you have gained access to more information. On top of the production budget, you also know how much the studio has spent on advertising, what the star power of the movie is , determined by the actors' number of twitter followers, for example, and the timing of the movie release. Let's see what a more complex neural network looks like.

5. Predicting box office revenue

First, consider this neuron whose job it is to estimate spend as a function of the budget and the advertising costs.

6. Predicting box office revenue

A second neuron tracks how aware people are that the movie has been released. The two things that feed into that are advertising and star power. The more famous your actors, the more aware people are of the movie.

7. Predicting box office revenue

So the second neuron is responsible for awareness.

8. Predicting box office revenue

Lastly, the distribution decisions made by the studio will come into play. Budget, advertising, and timing of the release all feed into this neuron,

9. Predicting box office revenue

that represents the movie's distribution.

10. Predicting box office revenue

Finally, now that the earlier neurons have figured out the importance of these higher-level concepts, we need to add one more neuron that takes these three factors as an input and outputs the estimated box office revenue. And that's the end of our neural network. Its job is to map relationships between different combinations of variables to the desired output.

11. Predicting box office revenue

From the explanation it seemed as if we had to figure out key relationships like spend, awareness, and distribution. To train a neural network, all you need is training data to input. It figures out all of the neurons in the middle by testing and analyzing relationships between the neurons.

12. Deep learning

We just saw an example of a rather small neural network. In reality neural networks are much larger with thousands of neurons. This is the point we start using the term deep learning. By stacking a large number of neurons they can compute incredibly complicated functions that give you very accurate mappings from the input to the output.

13. When to use deep learning?

So when should we choose Deep Learning as a solution? Deep Learning can outperform other techniques if the data size is large. But with a smaller dataset, traditional machine learning algorithms are preferable. Because of the complexity, deep learning techniques require powerful computers to train in reasonable time. When there is lack of domain knowledge for understanding the features, deep learning outshines traditional machine learning since the neural network figures them out for you. Deep Learning really shines when it comes to complex problems such as computer vision, and natural language processing. More on that later in this chapter.

14. Let's practice!

But first, let's practice!