================================================================= TITLE: Deep Learning 1 DATE: 2024-11-22 (November 22, 2024 at 01:41 PM) DURATION: 02:08:49 (7729 seconds) WORDS: 16,012 words SPEECH ID: 26XPVAWX2H2XOG5K ================================================================= --- AI SUMMARY --- deep learning, neural networks, cat recognizer, hyperparameter tuning, regularization, advanced optimization, machine learning project, convolutional neural networks, sequence models, natural language processing, supervised learning, housing price prediction, online advertising, computer vision, autonomous driving --- FULL TRANSCRIPT --- [00:00] 0: We may gain from [08:48:00] 0: calculation, in factoring to healthcare, to corporations and many more. And I think that today, we see a surprisingly clear path for AI to bring about an equally big transformation. And of course, the part of AI that is rising rapidly and driving along with these developments is deep learning. So today, deep learning is one of the most highly sought after skills in the technology world. And through this course, and a few courses after this one, I want to help you to gain and master those skills. So here's what you learn in this sequence of courses, also called a specialization Coursera, in the first course, you learn about the foundations of neural networks. You learn about neural networks and deep learning. This video that you're watching is part of this first course, which lasts four weeks in total. And each of the five courses in this specialization will be about two to four weeks, with most of them actually shorter than four weeks. But in this first course, you learn how to build a new network, including a deep neural network, and how to train it on data. And at the end of this course, you'll be able to build a deep neural network to recognize, guess what, cats. For some reason there is a cat meme running around in deep learning. And so following tradition, in this first course, we'll build a cat recognizer. Then in the second course, you learn about the practical aspects of deep learning. So you learn, now that you've built a neural network, how to actually get it to perform well. So you learn about hyperparameter tuning, regularization, how to find those guys in variance, and advanced optimization algorithms like momentum, RMS, prop and pattern optimization algorithm. Sometimes it seems like there's a lot of tuning, even some black magic and how you build in your network. So the second course, which is just three weeks, will demystify some of that black magic. In the third course, which is just two weeks, you learn how to structure your machine learning project. It turns out that the strategy for building a machine learning system has changed in the era of deep learning. So for example, the way you split your data into train development or depth also called out Product Validation says, [622:08:00] 0: So what are the new best practices, and [637:57:20] 0: what have your training set and your test set come from different distributions that's happening a lot during the error deep learning. So how do you deal with that? And if you've heard of end to end deep learning, you also learn more about that in this third course and see when you should use it, and then even you shouldn't. The material in this third course is relatively unique. I'm going to share with you a lot of the hard won lessons that I've learned building and shipping quite a lot of deep learning products. This, as I know this, is largely material that is not taught in most universities that have been doing courses. [807:06:40] 0: But I think it will help you to get your degree in [828:16:00] 0: systems. In the next course, we'll then talk about convolutional neural networks, often attributed CMS convolutional networks, or convolutional neural networks are often applied to images, so you learn how to build these models in course four. Finally, in course five, you learn sequence models and how to apply them to natural language processing and other problems. So sequence models includes models like recurrent neural networks. If you use RNNs and LSTM models, that's a long, short term memory models. You learn what these terms mean in course five and be able to apply them to natural language processing problems. So you learn these models in course five and be able to apply them to sequence data. So for example, natural language is just a sequence of words, and you also understand how these models can be applied to speech recognition or to music generation and other problems. So through these courses, you learn to choose a deep learning you'll be able to apply them to build amazing things, and I hope many of you through this will also be able to advance your career. So that let's get started. Please go into the next video we'll talk about deep learning applied to supervised learning. [1213:41:20] 0: The term deep learning refers to training neural networks, sometimes very large neural networks. So what exactly is a neural network in this video, let's try to give you some of the basic intuitions. Let's start with a housing price prediction example. Let's say you have a data set with six houses, so you know the size of the houses in square feet or square meters, and you know the price of the house. And you want to fit a function to predict the price of houses. Function of the size. So if you're familiar with linear regression, you might say, well, let's put a straight line to this data. So straight line like that. But to be bit fancier, you might say, Well, we know that prices can never be negative, right? So instead of a straight line, fit would eventually become negative. There's been the curve here. So this concepts, height as a function. [1460:53:20] 0: So you can think of [1488:21:20] 0: this function, the just fit to housing, as a very simple neural network is almost as simple as possible neural network. Let me draw it here. We have as the input to neural network the size of the house, X. It goes into this node, this little circle, [1596:58:40] 0: and then the outputs, [1606:50:40] 0: the pressure called y. So this little circle, which is a single neuron in our neural network, implements this function that we drew on your left, and all that the neuron does is it inputs the size, computes this linear function, takes a max of zero and then outputs, yes, there's a price. And by the way, in the neural network literature, you see this function a lot. This function which goes at zero sometime and takes off as a straight line. This function is called a value function, which stands for rectified. [1821:46:40] 0: Linear rectified just means taking a max of zero which is going to get a function shape like this. You don't need to worry about Rayleigh units for now, but it's just something you see again later in this course. So if this is a single neuron neural network, really a tiny little neural network, a larger neural network is then formed by taking many of these single neurons and stacking them together. So if you think of this neuron as being nailed like a single Lego break, you then get a bigger neural network by stacking together many of these Lego bricks. Let's see an example. Let's say that instead of predicting the price of a house just from the size, you now have other features you know, other things about the house, such as the number of bedrooms, 20 by this pound bedrooms. And you might think that, you know, one of the things that really affects the price of a house is family size. So, you know, it can just house fit your family of three, or family four, five, and it's really based on the size and square feet, or square meters and the number of bedrooms that determines whether or not a house can fit your values, value, size. And then maybe, you know the zip code in different countries is called the coastal code house. And the zip code maybe is a feature that tells you, you know, walkability, so is this neighborhood highly walkable? Just walks the grocery store, walk to school, to drive. Some people prefer highly walkable neighborhoods. And then the zip code as well, as you know, the wealth maybe tells you, right, certainly in the United States, that some of the countries as well, tells you how good is the school policy. So each of these little circles I'm drawing can be one of those very limited units or some other slightly non linear function, so that, based on the size and number of bedrooms, estimate the family size, their zip code, estimate, well estimate the school wealth policy. And finally, you might think that, well, the way people decide how much they're willing to pay for health is they look at the things that really matter to them, in this case, family size, walkability and school policy, and that helps you predict the price. So in this example, x is all of these four inputs, and y is the price you're trying to predict. And so by stacking together a few of the single neurons or the simple predictors we had from the previous slide, we now have a slightly larger neural network. How the magic of a neural network is that when you implement it, you need to give it just the input x and the output Y for a number of examples in trainer set, and all these things in the middle it will figure out by itself. So what you actually implement is. Is this where, here you have a neural network with four inputs, the size, number, bedrooms, zip code, postal code. [2721:04:00] 0: And so given these [2737:52:00] 0: input features, the job in the neural network will be to the price one and notice also that these circles that each of them takes as inputs all four input features. So for example, rather than saying this first node represents value size, value size depends only on the feature. Want this year to be, and we'll give you All four we say that neural network. [3026:24:00] 0: So that's the first neural network. It turns out that as you build out your own neural networks, before you find them to the most powerful supervised learning that you're trying to take an input x and map it to some output Y, like we just saw in the housing price prediction example. In the next video, let's go over some more examples of supervisors and some examples of [3168:42:40] 1: success because you get [3200:00:00] 1: I eat at home, that's why you're walking over, because you keep eating like you ate at home, you'll keep being a boy or a girl. It's time to become mad. [3262:56:00] 2: You got a dream, you got to protect it. [3301:36:00] 2: You people can't do [3306:29:20] 2: something themselves. They want to tell you you can't do it. You want something. Go get it, [3357:41:20] 2: period. Talented up naturally. Skill is only developed by powers [3376:05:20] 2: and powers and hours of beating on your craft to be able, at Any [3415:54:40] 1: moment, to sacrifice [3475:54:40] 1: and when you get to the point where all you want to do is be successful, as bad as you want to breathe, then you'll be successful. I'm here to tell you number one that most of you say you want to be successful, but you don't want it bad. You just kind of want it some of you want to sleep, successful sleep. Sleep is for those people who are poor. Broke. I'll sleep. We can stay here. If the shit kicked out of us, we will have some guest players. We can fight our way back. [3618:45:20] 1: We can climb out of hell one inch At a time I choose to fight back. [3822:13:20] 2: When you Walk, as [3873:09:20] 1: bad as it [3922:29:20] 2: goes breathe, [4177:46:40] 0: as well, there's been a lot of hype about neural networks, and perhaps some of that hype is justified, given how well they're working. But it turns out that so far, almost all the economic value created by your networks has been through one type of machine learning called supervised learning. Let's see what that means, and let's go over some examples In supervised learning, you have some input x, and you want to learn the function mapping out to some output y. So for example, just now, we saw the housing price prediction application where you input some features of a home and try to output or estimate the price Y. Here are some other examples that neural networks have been applied to very effectively. Possibly the single most lucrative application of deep learning today is online advertising, maybe not the most inspiring, but certainly very lucrative, in which, by inputting an ad, information about an ad that a website is thinking of showing you and some information about the user, neural networks have gotten very good at predicting Whether or not you click on an ad, and by showing you and showing users the ads that you're most likely to click on, this has been an incredibly lucrative application of neural networks at multiple companies, because the ability is to show you ads that you're more likely to click on as a direct impact on the bottom line of some of the very large online advertising companies. Computer Vision has also made huge strides in the last several years, mostly due to deep learning. So you might input an image, and once you output an index, say, from one to 1000 trying to tell you if this picture might be any point of, say, 1000 different images. So you might use that for photo tagging. I think the recent characters in speech recognition has also been very exciting, where you can now input an audio clip to a neural network and have it output a text transcript. Machine translation has also made huge strides thanks to deep learning, where now you can have a neural network input an English sentence and directly output, say a Chinese sentence. And in autonomous driving, you might input an image, say, a picture of what's in front of your car, as well as some information from a radar. And based on that, maybe a new network can be trained to tell you the position of the other cars on the road. So this becomes a key component in autonomous driving systems. So a lot of the value creation through neural networks has been through cleverly selecting what should be x and what should be y for your particular problem, and then fitting this supervised learning component into often a bigger system such as an autonomous vehicle. It turns out that slightly different types of neural networks are useful for different applications. For example, in the real estate application that we saw in the previous video, we used a relatively standard neural network architecture. Maybe for real estate and online advertising, might be a relatively standard neural network, right, like the one that we saw for image applications will often use convolutional neural networks, often abbreviated CNN and for sequence data. So for example, audio has a temporal component by audio is played out over time. So audio is most naturally represented as a one dimensional time sequence. It was a one dimensional temporal sequence. And so for sequence data, you often use an RNA of the current neural network language, English and Chinese, the alphabets or the words come one at a time. So language is also most naturally represented as sequence data, and so more complex versions of RNNs are often used for these applications, and then for more complex applications of autonomous driving, where you have an image that might suggest more or the CNN convolutional. In that structure and radar info, which is something, something quite different, you might end up with a more custom or some more complex hybrid network architecture. So just to be bit more concrete about what are the standard CNN and RNN architectures. So in the literature, you might have seen pictures like this, so that's a standard neural net. You might have seen pictures like this, but this is an example of a convolutional neural network, and we'll see in a later course exactly what this picture means and how you can implement this. But convolutional networks are often used for image data, and you might also see pictures like this, and you learn how to implement this data. Course recurrent neural networks are very good for this type of one dimensional sequence data. There is maybe a temporal component. You might also have heard about applications of machine learning to both structured data and unstructured data. Here's what determines being structured data means, basically, you know, databases of data. So for example, in housing price prediction, you might have a database with a column that tells you the size and the number of bedrooms. So this is structured data, or, you know, in predicting whether or not a user will click on an ad, you might have information about the user, such as the age someone clicks on the ad and then labels y that you're trying to predict. So that's structured data, bringing that each of the features, such as size of a house or not the bedrooms or the age of the user has a very well defined image. In contrast, unstructured data refers to things like audio, raw audio, or images where you might want to recognize what's in the image or text. Here, the features might be the pixel values in the image or the individual words in the piece of text. Historically, it's been much harder for computers to make sense of unstructured data compared to structured data. And in fact, the human race has evolved to be very good at understanding audio cues as well as images, and then text was a more recent invention, but people are just really good at interpreting unstructured data. And so one of the most exciting things about the rise of neural networks is that, thanks to deep learning, thanks to neural networks, computers are now much better at interpreting unstructured data as well compared to just a few years ago. And this creates opportunities for many new, exciting applications that do speech recognition, English recognition, natural language processing, context, much more than was possible even just two or three years ago. I think because people have a natural empathy to understanding unstructured data, you might hear about neural network successes on unstructured data more in the media, because it's just cool when a neural network recognizes a cat. We all like that, and we all know what that means. But it turns out that a lot of the short term economic value that neural networks are creating has also been on structured data, such as much better advertising systems, much better product recommendations, and just a much better ability to process the giant databases that many companies to make accurate predictions from them. So in this course, a lot of the techniques we'll go over will apply to both structured data and structured data. For the purposes of explaining the algorithms, we will draw a little bit more on examples that use unstructured data, but as you think through applications of neural networks within your own team, I hope you find both uses for them in both structured and unstructured data. So neural networks have transformed supervised learning and are creating tremendous economic value. It turns out, though, that the basic technical ideas behind neural networks have mostly been around, sometimes for many decades. So why is it, then that they're only just now taking off and working so well? In the next video, we'll talk about why is only quite recently that neural networks have become this incredibly powerful, too? [6755:33:20] 0: It. If the basic technical ideas behind deep learning, behind neural networks, have been around for decades, why are they only just now taken off in this video, let's go over some of the main drivers behind the rise of deep learning, because I think this will help you better spot the best opportunities within your own organization to apply these two over the last few years, a lot of people have asked me, Andrew, why is deep learning certainly working so well? And when I'm asked that question, this is usually the picture I draw for them. Let's say we plot a figure where on the horizontal axis we plot the amount of data we have for a task, and let's say, on the vertical axis, we plot the performance of our learning algorithm, such as the accuracy of our spam classifier or our accurate predictor, or the accuracy of our neural net for figuring out the position of other calls for our self driving car. It turns out, if you plot the performance of a traditional learning algorithm like support vector machine or logistic regression as a function of the amount of data you have, you might get a curve that looks like this, where the performance improves for a while as you add more data, and after a while, the performance pretty much plateaus. It's supposed to be a horizontal line. It didn't do whatever very well. It was as if they didn't know what to do with huge amounts of data. And what happened in our society over the last 20 years, maybe, is that for a lot of problems, we went from having a relatively small amount of data to having, you know, often a very large amount of data, but a lot of this was thanks to the digitization of a society where so much human activity is now in the digital realm, we spend so much time on the computers, on websites, on mobile apps and activities on digital devices, creates data, and thanks to the rise of inexpensive cameras, those cell phones, our cell environments, all sorts of sensors in the Internet of Things, we also just have been collecting more and more and more data. So over the last 20 years, for a lot of applications, we just accumulate a lot more data, more than traditional learning algorithms were able to effectively take advantage of. I advantage of and with neural networks. It turns out that if you train a small neural net, then its performance maybe looks like that if you train a somewhat larger neural net, let's call this a medium sized neural net, performance ultimately better and retrain a very large neural net, then this performance often just keeps getting better and better. So couple observations. One is, if you want to hit this very high level of performance, then you need two things. First, often you need to be able to train a big enough neural network in order to take advantage of a huge amount of data. And second, you need to be out here on the x axis. You do need a lot of data. So we often say that scale has been driving deep learning progress. And by scale, I mean both the size of the neural network, meaning just a neural network with a lot of hidden units, a lot of parameters, a lot of connections, as well as scale of their data. In fact, today, one of the most reliable ways to get that performance in the neural network is often to either train a bigger network or throw more data at it. And that only works up to a point, because eventually you run all the data, or eventually the neural network is so big that it takes too long to train. But just improving scale has actually taken us a long way in the world of deep learning. In order to make this diagram a bit more technically precise and just add a few more things, I wrote amount of data on the x axis, technically, this is amount of labeled data. Where, by labeled data, I mean training examples. We have both the input x and the label y. And to introduce a little bit of notation that we'll use later in this course, we're going to use lowercase alphabet M to denote the size of a training set. So the number of training examples is lowercase m. So that's the horizontal case. Couple other details to this figure. In this regime of small training sets, the relative ordering of the algorithms is actually not very well defined. So if you don't have a lot of training data, is often up to your skill and kind of genuine features that determines before. So it's quite possible that if someone training an SVM is more motivated to hand engineer features, and someone training even rationalize, maybe in this small training set regime, the SVM could do better. So you know, in this region to the left of the figure, the relative ordering to change the algorithms is not that well defined, and performance depends much more on your still at hygiene features and other little details in the algorithms and as elements, Big Data regime, very large string sets, very large M regime in the right that we more consistently see large units dominating the other approaches. And so if any of your friends ask you, why are neural nets taking off, I would encourage you to draw this picture for them as well. So I would say that in the early days, in the modern rise of deep learning, it was scale of data and scale of computation, just an ability to train very large neural networks, either on CPU on GPU that enabled us to make a lot of progress. But increasingly, especially in the last several years, we've been seeing tremendous algorithmic innovation as well as I also don't want to understate that, interestingly, many of the algorithmic innovations have been about trying to make neural networks run much faster. So as a contributing example, one of the huge breakthroughs in neural networks has been switching from a sigmoid function, which looks like this, to a random function we can talk about briefly in an earlier video that looks like this. If you don't understand the details of what I'm about to say, don't worry about it. But it turns out that one of the problems is using sigmoid functions and machine learning, is that there are these regions here where the slope of the function, where the gradient is nearly zero. And so learning becomes really slow, because when you think gradient descent into zero, the parameters just change very slowly. [8556:16:00] 0: Reverse by changing [8566:24:00] 0: what's called the activation function from the network to use this function. Rectified limits, the gradient is equal to one, but all positive values and so the gradient is likely to gradually shift to zero. Gradient, the slope of this might be zero for that, but it turns out that just by switching to the sigmoid function, to the daily function, has made an algorithm called gradient distance working faster. And so just an example of maybe relatively simple algorithm that also impacted this algorithm invasion was it really called computation. So there's actually quite a lot of examples like this, where it changed the algebra because it allows a COVID test. This allows us to completely neural networks, or to do so in a reasonable amount of time. The other reason that fast computation is important is that it turns out the process of training [8870:40:00] 0: network is very limited. [8876:16:00] 3: Often you [8888:00:00] 0: have an idea to architecture, and so you implement code, implementing UI, idea. Then let me explain the experiment which tells you the network does. And then, by looking at it, you go back the details, and then you go down this circle over and over. And when your neural network takes a long time to play, it just takes a long time to draw down some point. And there's a huge difference in your productivity building effective neural networks when you can have an idea and try to see their work or maybe what to do, versus sometimes just happens, because you get a result, you could just try a lot more ideas and be much more likely to discover. And so faster computation has really helped in terms of speeding up the ways at which you can get an experimental result, and this has really helped both practitioners of new networks as well as researchers working in deep learning iterate much faster and improve your ideas much faster. And so all this has also been a huge brewing to the entire deep learning research community, which has been incredible, and just inventing new algorithms and making non stop progress on that. So these are some of the forces powering the rise of deep learning. But the good news is that these forces are still working powerfully to make deep learning. Even better tick data. Society is still throwing up more and more digital data, or tick computation, with the rise of specialized hardware like GPUs and plastic networking, many types of hardware, I'm actually quite confident that our ability to build very large wealth, you know, shared computation, point of view, will keep on getting better and take algorithms. Well, the whole deep learning research community is still continuously phenomenal at innovating on the algorithms, right? So because of this, I think that you can be optimistic also the optimistic the deep learning will keep on getting better for many years to come. So that let's go on to the last video of the section where we'll talk a little bit more about what you learned from this course. [9570:34:40] 0: So you're just about to reach the end of the first week of material on the first course in this specialization. Let me give a quick sense of what you learn in the next few weeks, as well, as I said in the first video, this specialization comprises the five courses, and right now we're in the first of these five courses which teach you the most important foundations, really the most important building blocks of deep learning. So by the end of this first course, you know how to build and get to work a deep neural network. So here are the details of what is in this first course. This course has four weeks of material, and you're just coming up to the end of the first week. We just want the introduction to deep learning. At the end of each week, there will also be 10 multiple choice questions that you can use to double check your understanding of material. So when you're done watching this video, hope you go on to take a look at those questions in the second week, you then learn about the basics of neural network programming. You learn the structure of what are called the forward propagation and back propagation steps of the algorithm and how to implement neural networks efficiently, starting from the second week, you also get to do a programming exercise that lets you practice the material you just learn implement the algorithms yourself and see it work for yourself. I find it really satisfying when I learn about that algorithm, I get to code it up and I see it work for myself. So I hope you enjoy that too. Having learned the framework for neural network programming, in the third week, you code up a single hidden layer neural network so you learn about all the key concepts needed to implement and get to work in neural network. And then finally, before you build a deep neural network, a neural network with many layers and see it work with yourself. So that's Congratulations on finishing the videos up to this one. I hope that you now have a good, high level sense of what's happening deep learning, and perhaps some of you are also assigned to have some ideas of where you might want to adopt your network, in your network. This one, I hope that you now have the 10 multiple choice questions that follow this video equals website, and just use the 10 multiple choice questions to check your understanding. And don't worry if you don't get all the answers right the first time, you can try again and again until you get them all right. I found them useful to to make sure that you know I'm understanding all the concepts. I hope it'll help you that way too. So with that, congrats again, getting up to here, and I look forward to seeing you in The Week Two videos. You [12620:00:00] 2: What does [12656:53:20] 0: the analogy AI is The new electricity, referring to [12724:05:20] 0: I? These ideas that you learn about in this course, in [14542:45:20] 0: these videos, I hope to also ask these leaders of deep learning to give you career advice for how you can basically learn, for how you can do research or find a job interview as the first of this interview series, I'm delighted to have interviewing to you, an interview with Jackie Hanson. Welcome Jeff, and thank you for doing this interview with deep learning.ai. [14659:22:40] 3: Thank you for inviting me. I. [14669:36:00] 0: I think that at this point, you, more than anyone else on this planet, has invented so many of the ideas behind deep learning, and lot of people have been calling you the godfather of deep learning, although it wasn't until we're just chatting few minutes ago did I realize you think I'm the first one to call you that, which I'm quite happy to have done. But what I want to ask is, many people know you as a legend. I want to ask about your personal story behind the legend. So how did you get involved in going way back? How did you get involved in AI and machine learning and neural [14829:25:20] 3: networks? So when I was at high school, I had a classmate who was always better than me at everything. He was a brilliant mathematician, and he came into school one day and said, Did you know the brain uses holograms? [14899:22:40] 3: And I guess that was about 1966 [14919:06:40] 3: and I said, sort of what's a hologram? He explained that in a hologram, you can chop off half of it, you still get the whole picture, and that memories in the brain might be distributed over the whole brain. And so I guess he'd read about Lashley experiments, where you chop out bits of a rat's brain and discover it's very hard to find one bit where it stores one particular memory. So that's what first got me interested in, how does the brain store memories? And then when I went to university, I started off studying physiology and physics. I think when I was at Cambridge, I was the only undergraduate doing physiology and physics. And then I gave up on that. Tried to do philosophy, because I thought that might give you more insight, but that seemed to me, actually lacking in ways of distinguishing when they said something false. And so then I switched to psychology. And in psychology, they had very, very simple theories, and it seemed to me it was sort of hopelessly inadequate to explain what to brainstorm. So then I took some time off and became a carpenter, and then I decided to try AI, and I went off to Edinburgh to study AI with longit havens. And he had done very nice work on neural networks, and he'd just given up on neural networks and been very impressed by Winnie Greg's thesis. So when I arrived, he thought I was kind of doing this old fashioned stuff, and I ought to start on symbolic AI. And we had a lot of fights about that, but I just kept on doing what I [15343:17:20] 0: believed in. Then words, [15357:41:20] 3: I eventually got a PhD in AI, and then I couldn't get a job in Britain, but I saw this very nice advertisement for Sloan fellowships in California, and I managed to get one of those, and I went to California, and everything was different there. So in Britain, neural nets was regarded as kind of silly, and in California, Don Norman and David Ronald Hart were very open to ideas about neural nets. It was the first time I've been somewhere where thinking about how the brain works and thinking about how that might relate to psychology was seen as a very positive thing, and it was a lot of fun, and collaboration with David ramahat was great. [15575:49:20] 0: So this is when you were UCSD, and you and ramahart around what 1982 wound up writing the seminal background paper. [15616:05:20] 3: So actually, it was more complicated than that. What happened in I think I write early 1982 [15663:22:40] 3: David Ramel Hart and me, [15677:46:40] 3: and Ron Williams, [15691:22:40] 3: between us, developed the backprop algorithm. It was mainly David Ramel Hart's side game. We discovered later that many other people have invented it. David Parker had invented it, probably after us, but before we published, Paul World Boss had published it already quite a few years earlier, but nobody paid it much attention, and there were other people who developed very similar algorithms. It's not clear what's meant by backdrop, but using the chain rule to get derivatives is not a novel idea. [15836:37:20] 0: Why do you think it was your paper that helped so much the community latch onto a back problem? It feels like your paper marked an infection in the acceptance of this algorithm, whoever accepted it. So [15894:13:20] 3: we managed to get a paper into nature in 1986 and I do quite a lot of political work to get the paper accepted, I figured out that one of the referees was probably going to be Stuart Sutherland, who was a well known psychologist in Britain, and I went to talk to him for a long time and explained to him exactly what was going on, and he was very impressed by the fact that we showed that back prop. Could learn representations for words, and you could look at those representations which were little vectors, and you could understand the meaning of the individual features. So we actually changed from little triples of words about family trees, like Mary has mother Victoria, and you'd give it the first two words, and it would have to predict the last word. And after you trained it, you could see all sorts of features in the representations of the individual words, like the nationality of the person and their generation they were, which branch of the family tree they were in and so on. That was what made Stuart Sutherland really impressed with it. And I think that was when the paper got accepted. [16192:42:40] 0: Very early word embeddings, and you're already seeing teachers, very teachers of semantic movements emerge from their training. However, [16229:30:40] 3: yes, so from a psychologist's point of view, what was interesting was it unified two completely different strands of ideas about what knowledge was like. So there was the old psychologist view, but a concept is just a big bundle of features, and there's lots of evidence for that. And then there was the AI view of the time, which is a far more structuralist view, which was the concept is how it relates to other concepts. And to capture concept, you'd have to do something like a graph structure and maybe a semantic net. And what this back propagation example showed was you could give it the information that will go into a graph structure, or in this case, a family tree, and it could convert that information into features in such a way that you could then use the features to derive new, consistent information. I generalized, but the crucial thing was this to and fro between the graphical representation or the tree structured representation of the family tree, and a representation of the people as big feature vectors and the fact that you get from the graph like representation, you could get to the feature vectors, and from the feature vectors you could get more of the graph like [16569:04:00] 0: representation. So this is 1986 [16583:12:00] 3: in the early 90s, Bengio showed that you could actually take real data. You could take English text and apply the same techniques there and get embedded for real words from English text. And that impressed people a lot. I [16658:13:20] 0: guess. Recently, we've been talking a lot about how fast computers like GPUs and supercomputers is driving deep learning. I didn't realize that back in between 1986 to the early 90s, it sounds like between you and danger, or there was already the beginnings of this trend. [16728:10:40] 3: Yes, there was a huge advance. I mean, in in 1986 I was using a list machine, which was less than a 10th of a [16774:18:40] 3: mega flock. And by about 1993 [16792:58:40] 3: or thereabouts, people were seeing like 10 megaflops, so it's a factor of 100 and that's the point at which it was easy to use, because computers were just getting faster. [16833:20:00] 0: Over the past several decades, you've invented so many pieces of neural networks and deep learning. I'm actually curious of all of the things you've invented, which are the ones you're still most excited about today. [16893:36:00] 3: So I think the most beautiful one is the work I did with Terry senovsky on Boltzmann machines. So we discovered there was this really, really simple learning algorithm that applied to great big density connected nets where you could only see a few of the nodes, so it would learn hidden representations. And it was a very simple algorithm, and it looked like the kind of thing you should be able to get in the brain, because each synapse only needed to know about the behavior of the two neurons it was directly connected to, and the information that was propagated was the same. There were two different phases, which we called wake and sleep, but in the two different places, you're propagating information just the same way, whereas there's something like back propagation, there's a forward pass and a backward pass, and they work different if they're sending different kinds of signals, right? So I think that's the most beautiful thing. And for many years it looked like just like a curiosity, because it looked like it was much too slow. But then later on, I got rid of a little bit of the beauty, and instead of letting me settle down and just use one iteration in a simple in a somewhat simpler net, and that gave restricted pulse machines, which actually worked effectively in practice. So in the Netflix competition, for example, restricted bolt machines were one of the ingredients of the winning entry. [17241:57:20] 0: In fact, a lot of the recent resurgence of neonatal deep building starting about, I guess, 2007 was the restricted Bozo machine and deep, restricted Bosa machine work that you and your lab did, [17302:34:40] 3: yes, so that's another of the pieces of work I'm very happy with the idea of you could train the restrictive Bose machine. Which just had one layer of hidden features, and you could learn one layer of features, but then you could treat those features as data and do it again, and then you could treat the new features you've learned as data and do it again as many times as you liked. So that was nice. It worked in practice. And then you mighta realized that the whole thing could be treated as a single model, but it was a weird kind of model. It was a model where at the top you had a restricted Boltzmann machine, but below that you had a sigmoid belief net, which was something that Radford Neil had invented many years earlier. So it was a directed model, and what we've managed to come up with by training these restrictive boss machines was an efficient way of doing inference and Sigmoid Belief Nets. So around that time, there were people doing neural nets who would use densely connected nets but didn't have any good ways of doing probabilistic inference in them. And you had people doing graphical models, like Mike Jordan, who could do inference properly, but only in sparsely connected nets. And what we managed to show was, is a way of learning these deep belief nets, so that there's an approximate form of inference that's very fast. It just happens in a single forward pass. And that was a very beautiful result. And you could guarantee that each time you learned an extra layer of features, there was a band. Each time you learned a new layer, you got a new band. And the new band was always better than the old band, variational [17764:53:20] 0: band of shaders. You had layers. Yes, yeah. [17779:49:20] 3: So that was the second thing that I was really excited by. And I guess the third thing was the work I did with Bradford Neil on variation methods. It turns out people in statistics had done similar work earlier, but we didn't know about that, so we managed to make em work a whole lot better by showing you didn't need to do a perfect e step, you could do an approximate e step. And em was a big algorithm as statistics, and we'd showed a big generalization of it. But in particular, in 1993 I guess, with Van Camp, I did a paper that was, I think, the first variation of A's paper, where we showed that you could actually do a version of Bayesian learning that was far more tractable by approximating the true posterior with a Gaussian you could do that in a neural net. And I was very excited by [18027:01:20] 0: that. I see, Wow, great. Yep. I think I remember all of these papers, the new and Hinton approximate em paper, right? Spend many hours reading over that. And I think you know some of the albums you use today, or some of the albums that lots of people use almost every day are like things like dropouts or, I guess, value activations so came from your group, [18135:54:40] 3: yes and no. So other people have thought about rectified linear units, and we actually did some work with a stupid boss machine, showing that a ReLU was almost exactly equivalent to a whole stack of logistic units. And that's one of the things that helped relies catch on. [18220:00:00] 0: I was really curious about that the ReLU paper had a lot of math showing that this function can be approximated with this really complicated formula. Did you do that math so your paper would get acceptance in academic conference, or did all that math really influence the development of max of zero and x? [18313:41:20] 3: That was one of the cases where actually the math was important to the development of the idea. So I knew about rectified unions, obviously, and I knew about logistic units. And because of the work on Bolton machines, all of the basic work was done using logistic units. And so the question was, could the learning algorithm working something with rectified linen units, and by showing the rectified linear linear units were almost exactly equivalent to a stack of logistic units, [18453:03:59] 3: we showed them all the math would go through, I [18469:20:00] 0: see, and it provided me inspiration. But today, tons of people use ReLU, and it just works without, yet, without the same without necessarily needing to understand the same motivation. Yeah, one [18522:29:20] 3: thing I noticed later when I went to Google, I guess in 2014 [18546:29:20] 3: I gave a talk at Google about [18561:25:19] 3: using relus and visualizing with the identity metrics. Because the nice thing about remys is if you keep replicating the hidden layers and you initialize with the identity, it just copies the pattern in the layer below. And so I was showing you could train networks with 300 hidden layers, then you could train them really efficiently if you initialize with the identity. But I didn't pursue that. Any further, and I really regret not pursuing that. We published one paper with what believe, showing you could initialize a magic showing you could initialize recurrentness, like that. So I should have pursued it further, because later on, these residual networks were really that kind of thing over the years. [18751:12:00] 0: Approaches talk about their budget. Approaches talk about relationship the backprop and the brain. What are your current thoughts on that? [18789:25:20] 3: I'm actually working on a paper on that right now. [18810:29:20] 3: I guess my main thought is this, if it turns out the back prop is a really good algorithm for doing learning, then for sure, evolution could have figured out how to implement, I mean, you have cells that can turn into either eyeballs or teeth. Now, if cells can do that, they can for sure, implement back propagation, and presumably this huge selective pressure for it. So I think the neuroscientist idea that it doesn't look plausible is just silly. There may be some subtle implementation of it, and I think the brain probably has something that may not be exactly back propagation, but is quite close to it. And over the years, I've come up with a number of ideas about how this might work. So in 1987 [19018:40:00] 3: working with Jane McClelland, [19034:13:20] 3: I came up with the recirculation algorithm, where the idea is, [19059:33:20] 3: you send information around a loop, [19073:57:20] 3: and you try to make it so that things don't change as information goes around this loop. So the simplest version would be you have input units and hidden units, and you send information from the input to the hidden, and then back to the input, and then back to the hidden, and then back to the input, and so on. And what you want? You want to train an auto encoder, but you want to train it without having to do back propagation. So you just train it to try and get rid of all the variation in the activities. So the the idea is that the learning rule for synapse is change the weight in proportion to the pre synaptic input and in proportion to the rate of change of the postsynaptic input. But in recirculation, you're trying to make the postsynaptic input, you're trying to make the old one be good and the new won't be bad. So you're changing it in that direction. And we invented this algorithm before neuroscientists had come up with Spike time dependent plasticity. Spike time dependent plasticity is actually the same algorithm, but the other way round, where the new thing is good and the old thing is bad in the learning world. So you're changing the weight in proportion to the presynaptic activity times the new post an outlet activity minus the old one. [19427:38:40] 3: Later on, I realized in 2007 [19441:46:40] 3: that if you took a stack of bolts restricted Boltzmann machines and you trained it up after it was trained, you then had exactly the right conditions for implementing back propagation by just trying to reconstruct. If you looked at the reconstruction error, that reconstruction error would actually tell you the derivative of the discriminative performance. And I at the first deep learning workshop at nips in 2007 I gave a talk about that [19589:25:20] 3: that was almost completely ignored [19604:37:20] 3: later on, Joshua Bengio took up the idea, and that's actually done quite a lot more work on that, and I've been doing more work on it myself. And I think this idea that if you have a stack of auto encoders, then you can get derivatives by sending activity backwards and looking at reconstruction errors is a really interesting idea, and may well be how the brain does it. [19715:38:40] 0: One other topic that I know you thought a lot about, and I hear you're still working on is how to deal with multiple timescales in deep learning. So can you share your thoughts on that? Yeah, so [19773:04:00] 3: actually, that goes back to my first year as a graduate student. The first talk I ever gave was about using what I called fast rates, so weights that adapt rapidly but decay rapidly and therefore can hold short term memory. And I I showed in a very simple system in 1973 that you could do true recursion with those words. And what I mean by true recursion is that the the neurons that are used for representing things get reused for representing things in the recursive call, and the weights that are used representing knowledge get reused in the recursive call. And so that leaves the question of, when you pop out of a recursive call, how do you remember what it was you're in the middle of doing? Where's that memory? Because you use the neurons for the recursive call. And. And the answer is, you can put that memory into fast weights, and you can recover the activity states of the noise from those fast weights. And more recently, working with Jimmy Barr, we actually got a paper in nips about using fast weights for recursion like that. So that was quite a big gap. I the first model was unpublished in 1973 and then Julie bars model was in 2015 I think, or 2016 so it's about 40 years later. [20141:57:20] 0: And I guess one other idea coaches talk about for quite a few years now, over five years, I think, is capsules Where are you a guide? [20192:42:40] 3: Okay, so I'm back to the state I'm used to being in, which is I have this idea I really believe in, and nobody else believes it. And I submit papers about it, they all get rejected. But I really believe in this idea. I'm just going to keep pushing it so it hinges on. There's a couple of key ideas. One is about how you represent multi dimensional entities. And you can represent multi dimensional entities by just a little vector activities, as long as you know there's only one of them. So the idea is, in each region of the image, you'll assume there's at most one of a particular kind of feature, and then you'll use a bunch of neurons, and their activities will represent the different aspects to that feature. Like within that region, exactly what are his x and one coordinates what orientation is about how fast is it moving? What color is it? How bright is it, and stuff like that. So you can use a whole bunch of neurons to represent different dimensions of the same thing, provided there's only one of them. That's a very different way of doing representation from what we're normally used to, neural nets. Normally in neural nets, we just have a great big layer, and all the units go off and do whatever they do, and you don't think of bundling them up into little groups that represent different coordinates of the same thing. So I think there's, I think there should be this extra structure, and then the other, the other idea that goes with that. So this [20617:36:00] 0: means, in the distributed representation, you partition the representation to different subsets to represent right rather than I [20657:57:20] 3: call each of those subsets a capsule, and the idea of the capsule is able to represent an instance of a feature, but only one, and it represents all the different properties of that feature. So it's a feature that has lots of properties, as opposed to a normal neuron in a normal neural net, which is just like one scalar property. And then what you can do, if you've got that is, you can do something that normal neural nets are very bad at, which is you can do what I call routine by agreement. So let's suppose you want to do segmentation, and you have something that might be a mouth and something else that might be a nose, and you want to know if you should put them together to make one at one thing. So the idea is you have a capsule for a mouse that has the parameters of the mouse, and you have a capsule for a nose that has the parameters of the nose, and then to decide whether to put them together or not, you get each of them to vote for what the parameter should be for a face. Now, if the mouse and the nose are in the right spatial relationship, they will agree. So when you get two capsules at one level, voting for the same set of parameters in X level up, you can assume they're probably right, because agreement in a high dimensional space is very unlikely, and that's a very different way of doing filtering than what We normally use in neural nets. So I think this routing by agreement is going to be crucial for getting neural nets to generalize much better than limited data. I think it'd be very good at dealing with changes in viewpoint, very good at doing segmentation, and I'm hoping it will be much more statistically efficient than what we currently do in neural nets, which is if you want to deal with changes in viewpoint, and just give it a whole bunch of changes in viewpoint and training on them all, I see great, [21186:45:20] 0: great. So rather than people that are with supervised learning, you can learn this in some different [21219:17:20] 3: way. Well, I've still plan to do it with supervised learning, but the mechanics of the forward pass are very different. It's not a pure forward pass in the sense that there's little little bits of iteration going on, where you think you find a mouth and you think you found a nose, and you do a little bit of iteration to decide whether they should really go together to make a face. And you could do backdrops iteration. So you can train it all discriminatively. And we're working on that now at my group in Toronto. So I now have a little Google team in Toronto, part of the brain team. Yep, I see that's what I'm excited about that now look forward to that paper, if it comes out, you work in deep learning for several decades, [21453:41:20] 0: and actually really clears, how has your thinking [21484:53:20] 3: understanding? So I guess a lot of my intellectual history has been around back propagation and how to use back propagation, how to make use of its power. So to begin with, in the mid 80s, we're using it for discriminative learning. That was working well. I then decided by the early 90s that actually most human learning was going to be unsupervised learning, and I got much more interested in unsupervised learning, and that's when I worked on things like the wakes, deep out group, [21641:20:00] 0: and your comments at that time really influenced my thinking as well. So when I was leaving Google, building up [21688:00:00] 3: those projects because of your kids, right? And I may have misled you that is, in the long run, I think that supervised learning is going to be absolutely crucial, but you have to sort of face reality, and what's worked over the last 10 years or so is supervised learning, discriminative training, where you have labels, or you're trying to predict the next thing in the series so that access the label, and that's worked incredibly well. And I still believe that unsupervised learning is going to be crucial, and things will work incredibly much better than they do now, when we get that working properly, but we haven't yet. [21941:04:00] 0: I don't feel like well, [21951:44:00] 3: variational water intelligence, where you use the reprangerization tricks seem to me a really nice idea. And gender group adversarial nets also seem to me to be a really nice idea. I think gender of adversarial nets are one of the sort of biggest ideas in deep learning that's really new. I'm hoping I can make capsules that successful. But right now, generally, rather than serial nets, I think have been a big breakthrough. [22106:34:40] 3: What happened to sparsity? I was never as big on sparsity as you were, but [22145:04:00] 3: slow features, I think is a mistake. [22164:16:00] 3: You shouldn't say slow. The basic idea is right, but you shouldn't go for features that don't change. You should go for features that change in predictable ways. So here's the sort of basic principle about how you model anything [22234:40:00] 3: you take your measurements, [22249:41:20] 3: and you apply nonlinear transformations to your measurements until you get to a representation as a state vector in which the action is linear. So you don't just pretend it's linear, like you do requirement filters, but you actually find a transformation from the observables to the underlying variables, where linear operations like matrix multipliers on the underlying variables will do the work. So for example, if you want to change viewpoints, if you want to produce image from another viewpoint, what you should do is go from the pick service to coordinates, and once you got to the coordinate representation, which is the kind of thing I'm hoping practice will find, you can then do a matrix multiply to change viewpoint, and then you can map it back to pixels. That's why you did a very, very general principle. That's why you did all that work on face synthesis. [22477:36:00] 0: We take a face and compresses a very low dimensional vector, [22501:04:00] 3: change student who worked on that. I didn't do much work on that myself. I'm sure we still get off all the time if someone wants to break into what advice did [22569:25:20] 3: you have given a lot to people [22589:57:20] 2: doing okay, [22617:46:40] 3: so my advice is, sort of read the literature, but don't read too much of it. [22650:34:40] 3: So this is advice I got from my advisor. [22665:46:40] 3: We. Which is very unlike what most people say. Most people say you should spend several years reading the literature and then you should start working on your own ideas. And that may be true for some researchers, but for our creative researchers, I think what you want to do is read a little bit of the literature and notice something that you think everybody is doing wrong and contrarian in that sense, you look at it and it just doesn't feel right, and then figure out how to do it right. And then when people tell you that's no good, just keep at it. And I have a very good principle for helping people keep at it, which is, either your intuitions are good or they're not if your intuitions are good, you should follow them, and you'll eventually be successful. If your intuitions are not good, it doesn't matter what you're doing. [22922:34:40] 3: You might as well trust your intuitions. There's no point not trusting them. I [22950:08:00] 0: usually advise people to not just replicate public papers. Maybe that person is replicating [23003:12:00] 3: results. Yes, it's true that when you try and replicate a published paper, you discover all the little tricks necessary to make it to work. The other the other advice I have is never stop programming. Because if you give a student something to do, if they're a bad student, they'll come back and say it didn't work. And the reason it didn't work would be some little decision they made that they didn't realize was crucial. And if you give it to a good student like you. I tell you, for example, you can give him anything you know, come back and you'll say it work. I remember doing this once, and I said, But wait a minute, you work. Since we last talked, I realized you couldn't possibly work for the following reason. Oh, yeah. Well, I realized that right away, so I assumed you didn't mean that. I i See, like any other advice for [23253:04:00] 3: people, I think that's basically read enough so you start developing intuitions and then trust your intuitions and go, go for it. Don't be too worried if everybody else says it's nonsense. And I guess there's no way to know this [23312:05:20] 0: is nonsense, but you just have to go [23347:01:20] 3: there, right? But there is one way, there's one thing, which is, if you think it's a really good idea, and other people tell you it's complete nonsense. Then you know you're really onto something. So one example of that is when Radford and I first came up with variational methods. I sent mail explaining it to a former student of mine called Peter Brown, who knew a lot about em and he showed it to people who worked with him, called the della Pietro prophets, who were twins, I think, yes. And he then told me later what they said. And they said to him, I'm this guy's drunk, or he's just stupid. So they really, really thought it was nonsense. Now it couldn't be the part of the way I explained it, because I explained it in intuitive terms, but when people, when you have what you think is good idea, and other people think it's complete rubbish, that's the sign of a really good idea. And research topics, you know, new grad students will work on capsules. And one good piece of advice for new grad students is see if you can find an advisor who has beliefs similar to yours, because if you work on stuff that your advisor feels deeply about, you'll get a lot of good advice and time from your advisor. If you work on stuff your advisor is not interested. Not interested in, all you'll get is you'll get some advice, but it won't be anything useful. And last one on advice. How do you feel about people entering the PhD program? Versus health? [23833:36:00] 3: COVID? Do them. Yeah, it's complicated. I think right now, what's happening is there aren't enough academics trained in deep learning to educate all the people we need educated in universities. It just isn't the faculty bandwidth there. But I think that's going to be temporary. I think what's happened is depart most departments have been very slow to understand the kind of revolution that's going on. I kind of agree with you that it's it's not quite a second industrial revolution, but it's something on nearly that scale, and there's a huge sea change going on, basically because you. Our relationship to computers has changed. Instead of programming them, we now show them, when they figure it out that's a completely different way of using computers. And computer science departments are built around the idea of programming computers, and they don't understand that sort of this showing computers is going to be as big as programming. And so they don't understand that half the people in the department should be people who get computers to do things by showing [24136:21:20] 3: them, right? So my own department [24148:53:20] 3: refuses to acknowledge that [24163:01:20] 3: it should have lots and lots of people doing this. It thinks they've got it. They got a couple of, maybe a few more, but not too many. And in that situation, you have to remind the big companies to do quite a lot of the training. So Google is now training people, we call brain residents. [24247:06:40] 3: I suspect the universities will eventually [24263:54:40] 0: catch up. In fact, maybe a lot of students have figured this out. A lot of top PhD programs, you know, over half the pH the applicants are actually wanting to work on showing not even programming, in fact, to get credit where to do, whereas deep learning.ai, is creating a deep learning specialization first, I know the first deep learning MOOC was actually yours taught on Coursera back in 2012 as well. And somewhat strangely, that's when you first publish the RMS prop algorithm, which also interact, [24419:33:20] 3: right? Yes. Well, as as you know, that was because you invited me to do the MOOC, and then when I was very dubious about doing it, you kept pushing me to do it. So it was very good idea. And although it was a lot of work, yes, [24481:46:40] 0: yes. And thank you for doing that. I remember you complaining to me how much work it was, and you're staying out late at night. But I think you know many, many learners have benefited for your first group, and I still very grateful to you for it. That's good. Over the years, I've seen you in broaden debates about paradigms for AI and whether there's been a paradigm shift for AI. What are your Can you share your thoughts on that? [24597:52:00] 3: Yes, happening. [24608:00:00] 3: So I think in the early days, back in the 50s, [24625:20:00] 3: people like von Neumann and Turing didn't believe in symbolic AI. They were far more inspired by the brain. Unfortunately, they both died much too young, and their voice wasn't heard. And in the early days of AI, people were completely convinced that the representations you needed for intelligence were symbolic expressions of some kind sort of cleaned up logic where you could do non monotonic things, and not quite logic, but something like logic and that the essence of intelligence was reasoning. What's happened now is there's a completely different view, which is that what a thought is is just a great big vector of neural activity. So contrast that with a thought being a symbolic expression. And I think that people thought that thoughts were symbolic expressions just made a huge mistake. What comes in is a string of words, and what comes out is a string of words. And because of that, strings of words are the obvious way to represent things. So they thought what must be in between was a string of words or something like a string of words. And I think what's in between is nothing like a string of words. I think the idea that thoughts must be in some kind of language is as silly as the idea that understanding the layout of the spatial scene must be in pixels. Pixels come in. And if we could, if we had a dot matrix printer attached to us, then pixels will come out. But what's in between isn't pixels. And so I think salts are just these great big vectors. And the big vectors are causal powers. They cause other big vectors. And that's utterly unlike the standard AI view, with thoughts of symbolic expressions. [25119:28:00] 0: I guess AI says [25137:52:00] 3: because I thought that might give me more insight, but that seemed to me actually lacking in ways of distinguishing when they said something false. And so then I switched to psychology. And in psychology, they had very, very simple theories, and it seemed to me it was sort of hopelessly inadequate for explain what the brain was doing. So then I took some time off from the payment card. Okay, and been very impressed by Winograd thesis. So when I arrived, he thought I was kind of doing this old fashioned stuff. And I ought to start on symbolic AI, and we had a lot of fights about that, but I just kept on doing what I believed in, [25359:44:00] 0: and then what [25377:36:00] 3: I eventually got a PhD in AI, and then I couldn't get a job in Britain, but I saw this very nice advertisement for Sloan fellowships in California, and I managed to get one of those, and I went to California, and everything was different there. So in Britain, neural nets was regarded as kind of silly, and in California, Don Norman and David Ronald Hart were very open to ideas about neural nets. It was the first time I'd been somewhere where thinking about how the brain works and thinking about how that might relate to psychology was seen as a very positive thing, and it was a lot of fun. Now, in particular, collaborating with David rumelhart [25590:50:40] 0: was great, great. So this is when you were UCSD and UN rampart around what 1982 wound up writing, you know, the seminal background paper, right? So, [25637:52:00] 3: so actually, it was more complicated than that. What happened in, I think, around early 1982 David rommelhart and me and Ron Williams, between us, developed the backdrop algorithm. It was mainly David ramparts idea. We discovered later that many other people have invented it. David Parker had invented it, probably after us, but before we published, Paul werbos had published it already quite a few years earlier, but nobody paid it much attention, and there were other people who developed very similar algorithms. It's not clear what's meant by back prop, but using the chain rule to get derivatives was not a novel idea. [25856:10:40] 0: Why do you think it was your paper that helps so much the community latch onto back problem. It feels like your paper marked an infection in the acceptance of this algorithm, whoever accepted it. [25909:52:00] 3: So we managed to get a paper into nature in 1986 and I did quite a lot of political work to get the paper accepted. I figured out that one of the referees was probably going to be Stuart Sutherland, who was a well known psychologist in Britain. And I went to talk to him for a long time and explained to him exactly what was going on. And he was very impressed by the fact that we showed that back prop could learn representations for words, and you could look at those representations which were little vectors, and you could understand the meaning of the individual features. So we actually trained it on little triples of words about family trees, like Mary has mother Victoria, and you'd give it the first two words, and it would have to predict the last word. And after you trained it, you could see all sorts of features in the representations of the individual words, like the nationality of the person and their what generation they were, which branch of the family tree they were in, and so on. That was what made Stuart Sutherland really impressed with it. And I think that was why the paper got accepted [26213:36:00] 0: very early word embeddings, and you're already seeing features learn features of semantic meanings emerge from the training algorithm. Yes. [26253:09:20] 3: So from a psychologist point of view, what was interesting was it unified two completely different strands of ideas about what knowledge was like. So there was the old psychologist view that a concept is just a big bundle of features, and there's lots of evidence for that. And then there was the AI view of the time, which is a far more structuralist view, which was that a concept is how it relates to other concepts. And to capture concept, you'd have to do something like a graph structure or maybe a semantic net. And what this back propagation example showed was you could give it the information that would go into a grass structure, or in this case, a family tree, and it could convert that information into features in such a way that it could then use the features to derive new, consistent information. I generalize. But the crucial thing was this to and fro between the graphical representation or the the tree, structured representation of the family tree, and a representation of the people as big feature vectors. And the fact that you could from the graph like representation, you could get to the feature vectors, and from the feature vectors you could get more of the graph like representation. [26587:33:20] 0: So this is 1986 [26606:02:40] 3: in the early 90s, Bengio showed that you could actually take real data. You could take English text and apply the same techniques there and get embeddings for real words from English text and. And that impressed people a lot. I [26677:20:00] 0: guess recently, we've been talking a lot about how fast computers, like GPUs and supercomputers is driving deep learning. I didn't realize that back in between 1986 in the early 90s, it sounds like between you and Deng, there was already the beginnings of this trend. [26748:32:00] 3: Yes, there was a huge advance. I mean, in in 1986 I was using a lisp machine, which was less than a 10th of a [26793:57:20] 3: mega flop, and by about 1993 [26812:53:20] 3: or thereabouts, people were seeing like 10 mega flops. So it was a factor of 100 and that's the point at which it was easy to use because computers were just getting faster. [26853:46:40] 0: Over the past several decades, you've invented so many pieces of neural networks and deep learning. I'm actually curious of all of the things you've invented, which are the ones you're still most excited about today. [26912:58:40] 3: So I think the most beautiful one is the work I did with Terry senovsky on Boltzmann machines. So we discovered there was this really, really simple learning algorithm that applied to great big density connected nets where you could only see a few of the nodes, so it would learn hidden representations. And it was a very simple algorithm, and it looked like the kind of thing you should be able to get in a brain, because each synapse only needed to know about the behavior of the two neurons it was directly connected to, and the information that was propagated was the same. There were two different phases, which we called wake and sleep, but in the two different phases, you're propagating information in just the same way, whereas in something like back propagation, there's a forward pass and a backward pass, and they work differently. They're sending different kinds of signals, right? So I think that's the most beautiful thing. And for many years it looked like just like a curiosity, because it looked like it was much too slow. But then later on, I got rid of a little bit of the beauty, and instead of letting things settle down, just use one iteration in a somewhat simpler net, and that gave restricted Boltzmann machines, which actually worked effectively in practice. So in the Netflix competition, for example, restricted Boltzmann machines were one of the ingredients of the winning [27262:08:00] 0: entry. In fact, a lot of the recent resurgence of neural network deep learning is starting about, I guess, 2007 was the restricted bolsa machine and de restricted bolsa machine work that you and your lab did, yes, [27322:13:20] 3: so that's another of the pieces of work I'm very happy with the idea of that you could train a restricted bolster machine which just had one layer of hidden features, and you could learn one layer of features, and then you could treat those features as data and do it again, and then you could treat the new features you'd learned as data and do it again as many times as you liked. So that was nice. It worked in practice. And then you wait a realized that the whole thing could be treated as a single model. But it was a weird kind of model. It was a model where at the top you had a restricted Boltzmann machine, but below that you had a sigmoid belief net, which was something that Radford Neil had invented many years earlier. So it was a directed model, and what we'd managed to come up with by training these restricted Boltzmann machines was an efficient way of doing inference and Sigmoid Belief Nets. So around that time, there were people doing neural nets who would use densely connected nets, but didn't have any good ways of doing probabilistic inference in them. And you had people doing graphical models, like Mike Jordan, who could do inference properly, but only in sparsely connected nets. And what we managed to show was there's a way of learning these deep belief nets, so that there's an approximate form of inference that's very fast. It just happens in a single forward pass. And that was a very beautiful result. And you could guarantee that each time you learned an extra layer of features, there was a bound. Each time you learned a new layer, you got a new band, and the new band was always better than the old bound, variational [27783:28:00] 0: bound, showing that as you add layers the Yes, yeah. So [27802:56:00] 3: that was the second thing that I was really excited by. And I guess the third thing was the work I did with Bradford Neil on variation methods, it turns out people in statistics had done similar work earlier, but we didn't know about that, so we managed to make em work a whole lot better by showing you didn't need to do a perfect e step, you could do an approximate E step, and em was a big algorithm in statistics, and which showed a big generalization of it. And in particular, in 1993 I guess, with Van Camp, I did a paper that was, I think, the first variational Bayes paper, where we showed that you could actually do a version of. Bayesian learning that was far more tractable by approximating the true posterior with a Gaussian you could do that in neural net. And I was very excited by that. I [28049:36:00] 0: see, wow, right? Yep. I think I remember all of these papers, the neon Hinton approximate em paper, right? Spent many hours reading over that. And I think you know some of the algorithms you use today, or some of the algorithms that lots of people use almost every day, are what things like dropouts, or, I guess, value activations. So came from your group, [28155:33:20] 3: yes and no. So other people have thought about rectified linear units, and we actually did some work with restricted Boltz machines, showing that a ReLU was almost exactly equivalent to a whole stack of logistic units. And that's one of the things that helped relus catch on. [28240:10:40] 0: I was really curious about that the ReLU paper had a lot of math showing that this function can be approximated with this really complicated formula. Did you do that math so your paper would get a sentence in academic conference? Or did all that math really influence the development of max of zero and x? [28333:20:00] 3: That was one of the cases where actually the math was important to the development of the idea. So I knew about rectified linear units, obviously, and I knew about logistic units. And because of the work on Boltzmann machines, all of the basic work was done using logistic units. And so the question was, could the learning algorithm work in something with rectified linear units? And by showing the rectified linear linear units were almost exactly equivalent to a stack of logistic units. [28472:42:40] 3: We showed that all the math would go through, [28488:26:40] 0: I see, and it provided the inspiration. But today, tons of people use ReLU, and it just works without Yes, without the same Hello and welcome back in this week, we're going to go over the basics of neural network programming. It turns out that when you implement a neural network, there are some implementation techniques that are going to be really important. For example, if you have a training set of m training examples, you might be used to processing the training set by having a for loop step through your m training examples. But it turns out that when you implement a neural network, you usually want to process your entire training set without using an explicit for loops to loop over your entire training set. So this is how to do that in this week's materials, another idea when you organize the computation of a neural network, usually you have what's called a forward pass, or forward propagation step, followed by a backward pass, or what's called a backward propagation step. And so in this week's materials, you also gain intuition about why the computations in learning in a neural network can be organized in this board propagation and a separate backward propagation for this week's materials, I want to convey these ideas using logistic regression in order to make the ideas easier to understand. But even if you've seen logistic regression before, I think that there'll be some new and interesting ideas for you to pick up in this these materials so that let's get started. Logistic Regression is an algorithm for binary classification, so let's start by setting up the problem. Here's an example of a binary classification problem. You might have an input of an image like that, and want to output a label to recognize this image as being either a cat, in which case you output one, or non cat, in which case you output zero. And we're going to use to denote the output label. Let's look at how an image is represented in a computer to store an image. Your computer stores three separate matrices corresponding to the red, green and blue color channels of this image. So if your input image is 64 pixels by 64 pixels, then you would have 364, by 64 matrices corresponding to the red, green and blue pixel intensity values for your image. Although, to make these from the slide, I drew these as much smaller matrices. So these are actually five by four matrices, rather than 64 by 64 so to turn these pixel intensity values into a feature vector, what we're going to do is unroll all of these pixel values into a input feature vector x. So to unroll all of these pixel intensity values into a feature vector, what we're going to do is define a feature vector x corresponding to this image as follows, which is. Going to take all the pixel values, 255, 231, and so on. 255231, and so on, until we've listed all the red pixels and then eventually, 250, 513-425-5134, and so on, until we get a very long feature vector listing out all the red, green and blue pixel intensity values of this image. So if this image is a 64 by 64 image, the total dimension of this vector x will be 64 by 64 by three, because that's the total numbers we have in all of these matrices, which in this case, turns out to be 12288, that's what you get. You multiply out those numbers. And so we're going to use an x equals 12288, to represent the dimension of the input features x, and sometimes for gravity, I might also just use lowercase n to represent the dimension of this input feature vector. So in binary classification, our goal is to learn a classifier that can input an image represented by its feature vector x, and predict whether the corresponding label y is one or zero. That is whether this is a cat image or a non cat image. Let's now lay out some of the notation that we'll use throughout the rest of this course. A single training example is represented by a pair x, comma y, where x is an n, x dimensional feature vector and y, the label is either zero or one. Your training set will comprise lowercase m training examples, and so your training sets will be written, x1 comma y1 which is the input and output for your first training example, x2 comma y2 for your second training example, up to x m, comma y m, which is your last training example, and then that altogether, is your entire training set. So I'm going to use lowercase m to denote the number of training examples, and sometimes to emphasize that this is the number of training examples. I might write this as m subscript train. And when we talk about this test set, we might sometimes use M subscript test to denote the number of test examples. Finally, to put all of the training examples into a more compact notation, we're going to define a matrix capital X, as defined by taking your training set inputs, x1 x2 and so on, and stacking them in columns. So you take x1 and put that as the first column of this matrix, x2 put that as a second column, and so on, down to x m, then this is the matrix capital X. So this matrix X will have m columns where m is the number of training examples and the number of rows, or the height of this matrix is NX. Notice that in other causes, you might see the matrix capital x defined by stacking up the training examples in rows like so x1 transpose down to XM transpose. But it turns out that when you're implementing neural networks using this convention I have on the left will make the implementation much easier. So just to recap, x is a an x by m dimensional matrix, and when you implement this in Python, you see that x dot shape. That's the Python command for finding the shape of a matrix that this is an NX comma m. This just means it's an NX by m dimensional matrix. So that's how you group the training examples. Input X into matrix. How about the output labels, y. It turns out that to make your implementation of a neural network easier, it'll be convenient to also stack y in columns. So we're going to define capital Y to be equal to y1, y2, up to y, M, like so, so y. Here will be a one by m dimensional matrix. And again, to use the Python notation, the shape of y will be one comma m, which just means this is a one by m matrix. And as you implement your neural network later in this course, you find that a useful convention will be to take the data associated with different training examples, and by data, I mean either x or y or other quantities you see later, but to take the stuff or the data associated with different training examples and to stack them in different columns, like we've done here for both x and y. So that's the notation we'll use for. Logistic regression and for neural networks later in this course, if you ever forget what a piece of notation means, like, what is m or what is n or what is something else, we've also posted on the course website a notation guide you can use to quickly look up what any particular piece of notation means. So that let's go on to the next video. We'll start to fetch out logistic regression using this notation. [30807:01:20] 0: In this video, we'll go over logistic regression. This is a learning algorithm that you use when the output labels y in a supervised learning problem are either zero or one. So the binary classification problems, given an input feature vector X may be corresponding to an image that you want to recognize as either a cat picture or not a cat picture. You want an algorithm that can output a prediction, which you only call y hat, which is your estimate of y. More formally, you want y hat to be the probability of the chance that y is equal to one given the input features x. So in other words, if x is a picture, as we saw in the last video, you want y hat to tell you what is the chance that this is a cat picture. So X, as we said in the previous video, is a n x dimensional vector, given that the parameters of logistic regression will be w, which is also an n x dimensional vector, together with B, which is just a real number, say, given an input x and the parameters w and b, how do we generate the output Y hat? Well, one thing you could try that doesn't work would be to have Y hat be w, transpose X plus B, kind of a linear function of the input x. And in fact, this is what you use if you were doing linear regression. But this isn't a very good algorithm for binary classification, because you want y hat to be the chance that y is equal to one, so y hat should really be between zero and one, and it's difficult to enforce that, because W transpose X plus B can be much bigger than one, or it can even be negative, which doesn't make sense for a probability that you want to be between zero and one. So in logistic regression, our output is instead going to be y hat equals the sigmoid function applied to this quantity, this is what the sigmoid function looks like. If on the horizontal axis I plot z, then the function, sigmoid of Z looks like this, so it goes smoothly from zero up to one. Let me label my axes here. This is zero, and it crosses the vertical axis at 0.5 so this is what sigmoid of Z looks like. And we're going to use z to denote this quantity W transpose X plus B. Here's the formula for the sigmoid function, sigmoid of z, where z is a real number is one over one plus e to the negative z. So notice a couple things, if z is very large, then e to the negative z will be close to zero. So then sigmoid of z will be approximately one over one plus something very close to zero, because e to the negative of the very large number will be close to zero. So this is close to one. And indeed, We if you look in the plot on the left, if z is very large, then sigmoid of z is very close to one. Conversely, if z is very small, or if it's a very large negative number, then sigmoid of z becomes one over one plus e to the negative z, and this becomes e to a huge number. So this becomes, you know, think of it as one over one plus a number that is very, very big. And [31845:25:20] 0: and so that's close to zero. And indeed you see that as z becomes a very large negative number, sigmoid of z goes very close to zero. So when you implement logistic regression, your job is to try to learn parameters w and b so that y hat becomes a good estimate of the chance of y being equal to one before moving on, just another note on the notation. When we program neural networks, we'll usually keep the parameter W and parameter b separate, where, here B corresponds to. And the deceptive in some of the causes, you might have seen a notation that handles this differently. In some conventions, you define an extra feature called x zero and make that equal to one, so that now x is in R of MX plus one, and then you define y hat to be equal to sigma of theta transpose x. In this alternative notational convention, you have vector parameters, theta, theta zero, theta one, theta two, down to theta and x. And so theta zero plays the role of B, that's just a row number, and theta one down to theta NX play the row of W. It turns out, when you implement your neural network, will be easier to just keep B and W as separate parameters. And so in this class, we will not use any of this notational convention that I just wrote it in red. If you've not seen this notation before in other classes, don't worry about it. It's just that for those of you that have seen this notation, I wanted to mention explicitly that we're not using that notation in this course. But if you've not seen this before, it's not important and you don't need to worry about it. So you've now seen what the logistic regression model looks like. Next. To train the parameters w and b, you need to define A cost function. Let's do that in The Next You