Transcript for:
Artificial Intelligence, Machine Learning and Neural Networks

So in this first section, I'm going to spend a few minutes discussing the difference between artificial intelligence, neural networks and machine learning. And the reason we need to go into this is because we're gonna be covering all of these topics throughout this course. So it's vital that you guys understand what these actually mean. And you can kind of differentiate between them. So that's what we're gonna focus on. Now. Now, quick disclaimer here, just so everyone's aware, I'm using something called Windows Inc, this just default comes with Windows, I have a drawing tablet down here. And this is what I'm going to be using for some of the explanatory parts. But there's no real coding, just to kind of illustrate some concepts and topics to you. Now I have very horrible handwriting, I'm not artistic, whatsoever, programming is more definitely more of my thing than, you know, drawing and doing diagrams and stuff. But I'm going to try my best. And this is just a way that I find I can convey information the best to you guys. So anyways, let's get started and discuss the first topic here, which is artificial intelligence. Now, artificial intelligence is a huge hype nowadays. And it's funny because a lot of people actually don't know what this means. Or they tried to tell people that what they've created is not artificial intelligence, when in reality, it actually is. Now the kind of formal definition of AI and I'm just gonna read it off of my slide here to make sure that I'm not messing this up, is the effort to automate intellectual tasks normally performed by humans? Now, that's a fairly big definition, right? What is considered an intellectual task? And, you know, really, that doesn't help us too much. So what I'm going to do is bring us back to when AI was first created to kind of explain to you how AI has evolved and what it really started out being. So back in 1950, there was kind of a question being asked by scientists and researchers, can computers think, can we get them to figure things out? Can we get away from hard coding? And you know, having like, Can we get a computer to think and it do its own thing? So that was kind of the question that was asked. And that's when the term artificial intelligence was kind of coined and created. Now back then AI was simply a predefined set of rules. So if you're thinking about an AI for maybe like tic tac toe, or an AI for chess, all they would have had back then, is predefined rules that humans had come up with and typed into the computer in code. And the computer would simply execute those set of rules and follow those instructions. So there was no deep learning machine learning crazy algorithms happening, it was simply if you wanted the computer to do something, you would have to tell it beforehand, say you're in this position. And this happens, do this. And that's what AI was. And very good AI was simply just a very good set of rules where a ton of different rules that humans had implemented into some program, you could have AI programs that are stretching, you know, half a million lines of code, just with tons and tons and tons of different rules that have been created for that AI. So just be aware that AI does not necessarily mean anything crazy, complex, or super complicated. But essentially, if you're trying to simulate some intellectual task, like playing a game that a human would do with a computer, that is considered AI, so even a very basic artificial intelligence for Tic Tac Toe game where it plays against you, that is still considered AI. And if we think of something like Pac Man, right, where we have, you know, our little ghosts, and this will be my rough sketch of a ghost, we have our Pac Man guy who will just be this, would we consider this ghost AI, what it does is an attempt to find and kind of simulate how we get to Pac Man, right. And the way this works is just using a very basic pathfinding algorithm. This has nothing to do with deep learning, or machine learning or anything crazy. But this is still considered artificial intelligence, the computers figuring out how it can kind of play and do something by following an algorithm. So we don't necessarily need to have anything Crazy, Stupid complex to be considered AI, it simply needs to just be simulating some intellectual human behavior. That's kind of the definition of artificial intelligence. Now, obviously, today, AI has evolved into a much more complex field where we now have machine learning and deep learning and all these other techniques, which is what we're going to talk about now. So what I want to start by doing is just drawing a circle here. And I want to label this circle and say, A, I like that. So this is going to define AI, because everything I'm about to put inside of here is considered artificial intelligence. So now, let's get into machine learning. So what I'm going to do is draw another circle inside of here. And we're going to label this circle, ml for machine learning. Now notice I put this inside of the artificial intelligence circle. This is because machine learning is a part of artificial intelligence. Now, what is machine learning? Well, what we talked about previously, was kind of the idea that AI used to just be a predefined set of rules, right? Where what would happen is, we would feed some data, we would go through the rules by and then analyze the data with the rules and then we'd spit out some output which would be you know what we're going to do. So in the classic example of chess, say we're in check, what we pass that board information to the computer, it looks at it sets of rules, it determines we're in check and then it moves us somewhere else. Now what is machine learning in contrast to that Machine learning is kind of the first field that actually figuring out the rules for us. So rather than us hard coding the rules into the computer, what machine learning attempts to do is take the data and take what the output should be, and figure out the rules for us. So you'll often hear that, you know, machine learning requires a lot of data. And you need a ton of examples and, you know, input data to really train a good model. Well, the reason for that is because the way that machine learning works is it generates the rules for us. We give it some input data, we give it what the output data should be. And then it looks at that information and figures out what rules can regenerate, so that when we look at new data, we can have the best possible output for that. Now, that's also why a lot of the times, machine learning models do not have 100% accuracy, which means that they may not necessarily get the correct answer every single time. And our goal when we create machine learning models is to raise our accuracy as high as possible, which means it's going to make the fewest mistakes possible. Because just like a human, you know, our machine learning models, which are trying to simulate, you know, human behavior can make mistakes. But to summarize that, essentially machine learning the difference between that and kind of, you know, algorithms and basic artificial intelligence is the fact that rather get that rather than us the programmer giving it the rules, it figures out the rules for us. And we might not necessarily know explicitly what the rules are when we look at machine learning and create machine learning models. But we know that we're giving some input data, we're giving the expected output data, and then it looks at all of that information does some algorithms, which we'll talk about later on that and figures out the rules for us. So that later when we give it some input data, and we don't know the output data, it can use those rules that it's figured out from our examples and all that training data that we gave it to generate some output. Okay, so that's machine learning. Now we've covered AI and machine learning. And now it's time to cover neural networks or deep learning. Now, this circle gets to go right inside of the machine learning right here, I'm just going to label this one n n, which stands for neural networks, neural networks get a big hype, they're usually what the first, you know, when you get into machine learning, you want to learn neural networks are kind of like neural networks are cool, they're capable of a lot. But let's discuss what these really are. So the easiest way to define a neural network is it is a form of machine learning that uses a layered representation of data. Now, we're not going to really understand this completely right now. But as we get further in, that should start to make more sense as a definition. But what I need to kind of illustrate to you is that in the previous example, where we just talked about machine learning, essentially what we had is we had some input bubbles, which I'm going to define as these, we had some set of rules that is going to be in between here, and then we have some output. And what would happen is we feed this input to this set of rules, something happens in here, and then we get some output. And then that is what you know, our program does, that's what we get from the model, we pretty much just have two layers, we have kind of the input layer, the output layer, and the rules are kind of just what connects those two layers together. Now in neural networks, and what we call deep learning, we have more than two layers. Now I'm just trying to erase all this quickly. So I can show you that. So let's say and I'll draw this one another color, because why not? If we're talking about neural networks, what we might have, and this will vary, and I'll talk about this in a second is the fact that we have an input layer, which will be our first layer of data, we could have some layers in between this layer, that are all connected together. And then we could have some output layer. So essentially, what happens is, our data is going to be transformed through different layers, and different things are going to happen, there's gonna be different connections between these layers. And then eventually, we will reach an output. Now it's very difficult to explain neural networks without going completely in depth. So we'll cover a few more notes that I have here. Essentially, in neural networks, we just have multiple layers. That's kind of the way to think of them. And as we see machine learning, you guys should start to understand this more. But just understand that we're dealing with multiple layers. And a lot of people actually call this a multi stage information extraction process. Now, I did not come up with that term and guts from a book or something. But essentially, what ends up happening is we have our data at this first layer, which is that input information, which we're going to be passing to the model that we're going to do something with, It then goes to another layer where it will be transformed, it will change into something else using a predefined kind of set of rules and weights that we'll talk about later. Then it will pass through all of these different layers were different kind of features of the data, which again, we'll discuss in a second will be extracted will be figured out will be found until eventually we reach an output layer where we can kind of combine everything we've discovered about the data into some kind of output that's meaningful to our program. So that's kind of the best that I can do to explain neural networks without going on to a deeper level. I understand that a lot of you probably don't understand what they are right now and that's totally fine. But just know that there are layered representatives. data, we have multiple layers of information. Whereas in standard machine learning, we only have, you know, one or two layers. And then artificial intelligence in general, we don't necessarily have to have like a predefined set of layers. Okay, so that is pretty much it for neural networks, there's one last thing I will say about them is that they're actually not modeled after the brain. So a lot of people seem to think that neural networks are modeled after the brain and the fact that you have neurons firing in your brain. And that can relate to neural networks. Now, there is a biological inspiration for the name neural networks in the way that they work from, you know, human biology, but is not necessarily modeled about the way that our brain works. And in fact, we actually don't really know how a lot of the things in our brain operate and work. So it would be impossible for us to say that neural networks are modeled after the brain, because we actually don't know how information is kind of happens and occurs and transfers through our brain. Or at least we don't know enough to be able to say, this is exactly what it is a neural network. So anyways, that was kind of the last point there. Okay, so now we need to talk about data. Now data is the most important part of machine learning and artificial intelligence, neural networks as well. And it's very important that we understand how important data is and what the different kind of parts of it are, because they're going to be referenced a lot in any of the resources that we're using. Now what I want to do is just create an example here, I'm gonna make a data set that is about students final grades in like a school system. So essentially, we're gonna make this a very easy example, we're all we're going to have for this data set is we're going to have information about students, so we're gonna have their midterm one grade, their midterm to grade, and then we're gonna have their final grade. So I'm just gonna say mid term, one. And again, excuse my handwriting here, it's not the easiest thing to write with this drawing tablet. And then I'll just do final. So this is going to be our data set. And we'll actually see some similar data sets to this as we go through and do some examples later on. So for student one, which we'll just put some students here, we're going to have their midterm one grade, maybe that's a 70, their midterm to grid, maybe that was an 80. And then let's say their final was like their final term grade, not just the mark on the final exam, let's give them a 77. Now for midterm one can give someone a 60, maybe we give them a 90, and then we determine that the final grade on their exam was, let's say, an 84. And then we could do something with maybe a lower grade here, so 4050, and then maybe they got a 38, or something in the final grade. Now, obviously, we could have some other information here that we're admitting like maybe there was some exams, some assignments, whatever some other things they did that contributed to their grade. But the problem that I want to consider here is the fact that given our midterm, one grade and our midterm to grid and our final grade, how can I use this information to predict any one of these three columns. So if I were given a student's midterm, one grade, and I were given a student's final grade, how could I predict their midterm to grade. So this is where we're going to talk about features and labels. Now, whatever information we have that is the input information, which is the information we will always have that we need to give to the model to get some output is what we call our features. So in the example where we're trying to predict midterm two, and let's just do this and highlight this in red, so we understand what we would have as our features, our input information are going to be midterm one and final. Because this is the information we're going to use to predict something it is the input, it is what we need to give the model. And if we're training a model to look at midterm one and final grade, whenever we want to make a new prediction, we need to have that information to do so. Now what's highlighted in red, so this midterm two here is what we would call the label or the output. Now, the label is simply what we are trying to look for or predict. So when we talk about features versus labels, features is our input information, the information that we have that we need to use to make a prediction. And our label is that output information that is just representing you know what we're looking for. So when we feed our features to a model, you will give to us a label. And that is kind of the point that we need to understand. So that was the basic here. And now I'm just going to talk a little bit more about data because we will get into this more as we continue going, and about the importance of it. So the reason why data is so important is this is kind of the key thing that we use to create models. So whenever we're doing AI and machine learning, we need data pretty much unless you're doing a very specific type of machine learning and artificial intelligence, which we'll talk about later. Now for most of these models, we need tons of different data, we need tons of different examples. And that's because we know how machine learning works now, which is essentially, we're trying to come up with rules for a data set. We have some input information, we have some output information or some features and some labels, we can give that to a model and tell it to start training and what it will do is come up with rules such that we can just give some features to the model in the future and then it should be able To give us a pretty good estimate of what the output should be. So when we're training, we have a set of training data. And that is data where we have all of the features and all of the labels. So we have all of this information, then when we're going to test the model or use the model later on, we would not have this midterm two information, we wouldn't pass this in the model, we would just pass our features, which is midterm one and final and then we would get the output of midterm two. So I hope that makes sense. That just means data is extremely important. If we're feeding incorrect data or data that we shouldn't be using to the model that could definitely result in a lot of mistakes. And if we have incorrect output information or incorrect input information that is going to cause a lot of mistakes as well, because that is essentially what the model is using to learn and to kind of develop and figure out what it's going to do with new input information. So anyways, that is enough of data. Now let's talk about the different types of machine learning.