Hello world, it’s Seraj and welcome to Intro to Deep Learning. In this first episode, we’ll predict an animal’s body weight given only the weight of its brain. This course will be four months long and it’ll all be released on my channel. I have a live session every Wednesday at 10 am PST that explains every week’s topic in depth. And I’m collaborating with Udacity to offer a Nanodegree to those that successfully complete this course. This course is for anyone who wants to learn how to harness the incredible power of neural networks and become a deep learning engineer. You don’t have to be an experienced developer or mathematician. The only prerequisite for this course is knowing quantum mechanics. Just kidding, only basic Python syntax.

We’ll learn what we need to along the way by building an AI that can do everything from predicting the price of Tesla stock to painting surrealist masterpieces. Traditionally, programming has been about defining every single step for a program to reach an outcome. The machine only flips that approach. With machine learning, we define the outcome and the program learns the steps to get there. So, if I wanted to build an app that can recognize California license plates. And started writing out code to recognize the hundreds of different features of a license plate like the shape of certain letters and the colors. We just say, here are some examples of a California license plate, learn the steps you need so that you can recognize it.

Or if I wanted to make a bot that could beat Super Mario, instead of writing code for every possible scenario like jumping and it’s running towards you, we’d say the goal is to get to the endpoint without dying, learn the steps to get there. And sometimes we don’t even have an idea what steps could possibly be. Like if we’re a bank and we suspect there’s some kind of fraudulent activity happening but we’re not sure exactly how to detect that or even know what to look for, we can say, here’s a log of all user activity. Find the users that are unlike the rest, and it will learn the steps to detect the anomalies by itself. Machine learning is already everywhere on the Internet. Every major service uses it in some way. In fact, you could be using it right now to decide which other videos you might like as you watch this. And its uses will only grow over time.

It will be embedded in all of our Internet connected devices. Everything from fridges, to cars, to personal assistance. Re-learning and adapting to our needs. And you know that rule that says you need 10,000 hours to master any skill or we’ll just be able to off load that training time to our machines and it’ll give us super powers instantly. Anyone will be able to compose a symphony. Alexa I feel melancholic. Make me a piano piece for this. And have a beat to it. Yo. Anyone will be able to direct a movie. Okay, Hugo recreate Star Wars but put me in it. I doctorize most of my code now. >> You’re breaking my heart. >> Damn right. With machine learning, if you can trim it, it can exist. And the field is currently advancing very fast as researchers build on each other’s work. My neuronet sucks. Go deeper. Wow, I just achieved state of the art.

There are a lot of machine running models out there and one of them is called a Neural Network. When we use a neural network that’s not just one or two, but many layers deep to make a prediction, we call that deep learning. It’s a subset of machine learning that has outperformed almost every other type of model almost every time on a huge range of tasks.

We’ll dive into deep learning more in the next episode but this video will just focus on machine learning in general. We usually class learning into three different styles. The first style is called supervised learning. It’s where we give a model a labeled data set like car pictures so it gets feedback on what’s correct and what’s not. It just have to learn the mapping between the labels and the data. And then they can solve some given task like classifying the type of car in an image. It’s all relatively straight forward and we’ve gotten the incredible results from it. The second learning style is called unsupervised learning. This is when we give a model a data set without labels, it gets no feedback on what’s correct or not. It has to learn by itself, what the structure of the data is to solve some given task. This is harder to do but more convenient, since not everyone has a perfectly labeled data set sitting around.

Most data is unlabeled. It’s messy and complex. And the third type is reinforcement learning. This is where a model isn’t given feedback right off the bat, it only gets it if it achieves its goal. So if we’re trying to create a reinforcement learning bot that can learn to beat humans at chess, it would only receive feedback if it won the game whereas in the supervised approach we get feedback every move and in the unsupervised approach we’d never get feedback, even if it won. Unlike the other two learning styles, reinforcement learning is linked to the idea of interacting with an environment through trial and error. So I’ve got a data set of measurements of different animals and we want to predict an animals body weight given its brain weight. Since our data is labeled, this will be a supervisor approach and the type of machine learning task will perform is called regression. We’ll write out a 10 line Python script to do this and I’ll explain things as we go. We’ll start off by importing our three dependencies. The first one is pandas which will let us read our data set. The second one is scikit learn which is the machine learning library we’re using for this example.

And a third is matplotlib which will let us visualize our model and data. Now that we’ve imported our dependencies, we can read our data set using pandas. We’ll use the read fwf function to read our animal data set, a table of fixed width formatted lines into a pandas data frame object which is a 2D data structure of rows and columns. Our data set contains the average brain and body weight for a number of animal species. Once our data is in our dataframe variables, we can easily parse and read both measurements into two separate variables.

We’ll store our brain measurements in the x_values variable and the body measurements in the y_values variable. So, if we were to plot this data right now on a standard 2D graph, it would look like this. And our goal is that given a new animal’s body weight will be able to predict what its brain size is. So how are we going to do that? Yeah, uh-huh. You know what it is. Independent and dependent, independent and dependent. My data’s got the values for the brain and the body weight. And i’m wondering what to use to find if they relate. Linear Regression. Helps find the relationship. We’re going to measure it and find the only line of best fit.

The equation y = mx +b is all we need. B is the y intercept and m measures how steep. Plied it on the graph, let us predict the body with the brain. Low hair, pop champagne. >> When you set to learn linear model object to initialize our linear regression and store it in the body regression variable. Then we can fit our model on our x y value pairs. Now that we have the line that best fit we can plot our x, y value pairs on a scatter plot. Then plot our regression line by saying for every x value we have predict the associated y value and draw a line that intersects all those points. We can then display it using the show function. Let’s go ahead compile this code in terminal. Our scatter plot will appear with all our data points mapped out. The x axis represents brain weights and the y axis represents body weights. Our regression lines seems to fit most of the data pretty well and there seems to be a very strong correlation here between brain weight and body weight. And as we move along the line, given any brain weight we can also predict the associated body weight.

So to break it down while traditional programming is about defining the steps to reach an outcome, machine learning is about defining the outcome. And our program will learn the steps to get there. There are three different learning styles, supervised, unsupervised and reinforcement learning. And linear regression models, the relationship between an independent and dependent variable to create the line of best fit which we can then use to make predictions. The winner of last week’s Coding Challenge is Mick Van Hulst. He modified the game world to be more complex. And his queue learning bot was much more efficient at reaching the goal than my demo bot. Wizard of the week. And the runner up is Vishal Batchu. He generated maps using cellular automata. The challenge for this video is to use scikit-learn to create a regression line for a different data set that I’ll provide, and print out the error between your prediction and the actual value. Details are in the Readme, post your GitHub link in the comments and I’ll announce the winner in one week. Please hit that Subscribe button and for now, I’ve gotta feel to learn, so thanks for watching.

.

## Comments

Comments are disabled for this post.