Perhaps the hottest topic in the world right now is artificial intelligence. When people talk about this, they often talk about machine learning, and specifically, neural networks.
Now, neural networks should be familiar with you. If you put your hands like this, left and right, do it, then between your hands is a big neural network called your brain with something like 10 to 11 neurons, is crazy. What people have done in the last decades kind of abstracted this big mass in your brain into a basis set of equations that emulate a network of artificial neurons. Then people have invented ways to train these systems based on data.
So, rather than instructing a machine with rules like a piece of software, these neural networks are trained based on data.
So, you’re going to learn the very basics for now, perception, backpropagation, terminology that doesn’t make sense yet, but by the end of this unit, you should be able to write and code and train your own neural network.
That’s is so fun!
A Note on Deep Learning
The following lessons contain introductory and intermediate material on neural networks, building a neural network from scratch, using TensorFlow, and Convolutional Neural Networks:
- Neural Networks
- TensorFlow
- Deep Neural Networks
- Convolutional Neural Networks
Linear to Logistic Regression
Linear regression helps predict values on a continuous spectrum, like predicting what the price of a house will be.
How about classifying data among discrete classes?
Here are examples of classification tasks:
- Determining whether a patient has cancer
- Identifying the species of a fish
- Figuring out who’s talking on a conference call
Classification problems are important for self-driving cars. Self-driving cars might need to classify whether an object crossing the road is a car, pedestrian, and a bicycle. Or they might need to identify which type of traffic sign is coming up, or what a stop light is indicating.
In the next video, Luis will demonstrate a classification algorithm called “logistic regression”. He’ll use logistic regression to predict whether a student will be accepted to a university.
Linear regression leads to logistic regression and ultimately neural networks, a more advanced classification tool.
QuiZ:
So let’s say we’re studying the housing market and our task is to predict the price of a house given its size. So we have a small house that costs $70,000 and a big house that costs $160,000.

We’d like to estimate the price of these medium-sized house over here. So how do we do it?
Well, first we put them in a grid where the x-axis represents the size of the house in square feet and the y-axis represents the price of the house. And to help us out, we have collected some previous data in the form of these blue dots.

These are other houses that we’ve looked at and we’ve recorded their prices with respect to their size. And here we can see the small house is priced at $70,000 and the big one at $160,000.
Now it’s time for a small quiz.
What do you think is the best estimate for the price of the medium house given this data?
Would it be $80,000, $120,000 or $190,000?
Yes you are right: The answer is 120,000. But how we do that?
Well to help us out, we can see that these points can form a line. And we can draw the line that best fits this data. Now on this line, we can see that our best guess for the price of the house is this point here over the line which corresponds to $120000.
So if you said $120000, that is correct.
This method is known as linear regression. You can think of linear regression as a painter who would look at your data and draw the best fitting line through it. And you may ask, “How do we find this line?”
Well, that’s what the rest of the section will be about.
Linear to Logistic Regression
Linear regression helps predict values on a continuous spectrum, like predicting what the price of a house will be.
How about classifying data among discrete classes?
Here are examples of classification tasks:
- Determining whether a patient has cancer
- Identifying the species of a fish
- Figuring out who’s talking on a conference call
Classification problems are important for self-driving cars. Self-driving cars might need to classify whether an object crossing the road is a car, pedestrian, and a bicycle. Or they might need to identify which type of traffic sign is coming up, or what a stop light is indicating.
In the next video, I will demonstrate a classification algorithm called “logistic regression”. I’ll use logistic regression to predict whether a student will be accepted to a university.
Linear regression leads to logistic regression and ultimately neural networks, a more advanced classification tool.
Problem:
So, let’s start with one classification example.
Let’s say we are the admissions office at a university and our job is to accept or reject students. So, in order to evaluate students, we have two pieces of information, the results of a test and their grades in school.
So, let’s take a look at some sample students. We’ll start with Student 1 who got 9 out of 10 in the test and 8 out of 10 in the grades. That student did quite well and got accepted. Then we have Student 2 who got 3 out of 10 in the test and 4 out of 10 in the grades, and that student got rejected.
And now, we have a new Student 3 who got 7 out of 10 in the test and 6 out of 10 in the grades, and we’re wondering if the student gets accepted or not. So, our first way to find this out is to plot students in a graph with the horizontal axis corresponding to the score on the test and the vertical axis corresponding to the grades, and the students would fit here.
The students who got three and four gets located in the point with coordinates (3,4), and the student who got nine and eight gets located in the point with coordinates (9,8).

And now we’ll do what we do in most of our algorithms, which is to look at the previous data.
This is how the previous data looks. These are all the previous students who got accepted or rejected.
The blue points correspond to students that got accepted, and the red points to students that got rejected.

So we can see in this diagram that the students would did well in the test and grades are more likely to get accepted, and the students who did poorly in both are more likely to get rejected.
So let’s start with a quiz.
The quiz says, does the Student 3 get accepted or rejected?
What do you think?
The answer is: Student 3 is pass.
Correct. Well, it seems that this data can be nicely separated by a line which is this line over here,
and it seems that most students over the line get accepted and most students under the line get rejected.
So this line is going to be our model. The model makes a couple of mistakes since there area few blue points that are under the line and a few red points over the line. But we’re not going to care about those. I will say that it’s safe to predict that if a point is over the line the student gets accepted and if it’s under the line then the student gets rejected.

So based on this model we’ll look at the new student that we see that they are over here at the point 7:6 which is above the line. So we can assume with some confidence that the student gets accepted. so if you answered yes, that’s the correct answer.
And now a question arises. The question is, how do we find this line?
So we can kind of eyeball it. But the computer can’t. We’ll dedicate the rest of the session to show you algorithms that will find this line, not only for this example, but for much more general and complicated cases. But we will talk about that in my next post. See you later!
2 thoughts on “Neural Network”