The following is a conversation with Andrew Ng, one of the most impactful educators, researchers, innovators, and leaders in artificial intelligence and technology space in general. He co-founded Coursera and Google Brain, launched Deep Learning AI, Landing AI, and the AI Fund, and was the chief scientist at Baidu. As a Stanford professor and with Coursera and Deep Learning AI, he has helped educate and inspire millions of students, including me. This is the Artificial Intelligence Podcast. If you enjoy it, subscribe on YouTube, give it five stars on Apple Podcast, support it on Patreon, or simply connect with me on Twitter at Lex Fridman, spelled F-R-I-D-M-A-N. As usual, I'll do one or two minutes of ads now and never any ads in the middle that can break the flow of the conversation. I hope that works for you and doesn't hurt the listening experience. This show is presented by Cash App, the number one finance app in the App Store. When you get it, use code Lex Podcast. Cash App lets you send money to friends, buy Bitcoin, and invest in the stock market with as little as one dollar. Broker services are provided by Cash App Investing, a subsidiary of Square, a member SIPC. Since Cash App allows you to buy Bitcoin, let me mention that cryptocurrency in the context of the history of money is fascinating. I recommend The Ascent of Money as a great book on this history. Debits and credits on ledgers started over 30,000 years ago. The US dollar was created over 200 years ago, and Bitcoin, the first decentralized cryptocurrency, released just over 10 years ago. So given that history, cryptocurrency is still very much in its early days of development, but is still aiming to and just might redefine the nature of money. So again, if you get Cash App from the App Store or Google Play and use the code Lex Podcast, you'll get ten dollars, and Cash App will also donate ten dollars to FIRST, one of my favorite organizations that is helping to advance robotics and STEM education for young people around the world. And now here's my conversation with Andrew Ng.
The courses you taught on machine learning at Stanford and later on Coursera that you co-founded have educated and inspired millions of people. So let me ask you, what people or ideas inspired you to get into computer science and machine learning when you were young? When did you first fall in love with the field is another way to put it?
Growing up in Hong Kong, Singapore, I started learning to code when I was five or six years old. At that time, I was learning the BASIC programming language, and they would take these books and you know they'll tell you type this program into your computer. I'd type that program on my computer, and as a result of all that typing, I would get to play these very simple shoot-em-up games that you know I had implemented on my little computer. So I thought it was fascinating as a young kid that I could write this code that was really just copying code from a book into my computer to then play these cool little video games. Another moment for me was when I was a teenager, and my father, who's a doctor, was reading about expert systems and about neural networks. So he got me to read some of these books, and I thought it was really cool you could write a computer that started to exhibit intelligence. Then I remember doing an internship while I was in high school. This is in Singapore, where I remember doing a lot of photocopying and as office assistant. And the highlight of my job was when I got to use the shredder. So the teenager of me remember thinking, boy, this is a lot of photocopying. If only we could write software, build a robot, something to automate this, maybe I could do something else. So I think a lot of my work since then has centered on the theme of automation. Even the way I think about machine learning today, we're very good at writing learning algorithms that can automate things that people can do. Or even launching the first MOOCs, massive open online courses, that later led to Coursera. I was trying to automate what could be automatable in how I was teaching on campus, the process of education, tried to automate parts of that to make it more sort of to have more impact from a single teacher, single educator.
Yeah. I felt, you know, teaching at Stanford, I was teaching machine learning to about 400 students a year at the time. And I found myself filming the exact same video every year, like telling the same jokes in the same room. And I thought, why am I doing this? Why don't we just take last year's video and then I can spend my time building a deeper relationship with students. So, that process of thinking through how to do that, that led to the first MOOCs that we launched.
And then you have more time to write new jokes. Are there favorite memories from your early days at Stanford teaching thousands of people in person and then millions of people online?
You know, teaching online, what not many people know was that a lot of those videos were shot between the hours of 10:00 p.m. and 3:00 a.m. A lot of times, we were launching the first Stanford course. We already announced the course, about 100,000 people signed up. We just started to write the code, and we had not yet actually filmed the video. So, we had a lot of pressure, 100,000 people waiting for us to produce the content. So many Fridays, Saturdays, I would go out, have dinner with my friends, and then I would think, okay, do you want to go home now or do you want to go to the office to film videos? And the thought of being able to help 100,000 people potentially learn machine learning, fortunately that made me think, okay, I want to go to my office, go to my tiny little recording studio. I would adjust my Logitech webcam, adjust my Wacom tablet, make sure my lapel mic was on, and then I would start recording often until 2:00 a.m. or 3:00 a.m. I think it's unfortunate that it doesn't show that it was recorded that late at night, but it was really inspiring the thought that we could create content to help so many people learn about machine learning.
How did that feel? The fact that you're probably somewhat alone, maybe a couple of friends, recording with a Logitech webcam and kind of going home alone at one or 2 a.m. at night, and knowing that that's going to reach sort of thousands of people, eventually millions of people. Is what's that feeling like? I mean, is there a feeling of just satisfaction of pushing through?
I think it's humbling, and I wasn't thinking about what I was feeling. I think one thing that I'm proud to say we got right from the early days was I told my whole team back then that the number one priority is to do what's best for learners, do what's best for students. And so when I went to the recording studio, the only thing on my mind was what can I say? How can I design my slides? What do I need to draw right to make these concepts as clear as possible for learners. I think you know I've seen sometimes instructors, it's tempting to hey let's talk about my work, maybe if I teach you about my research someone will cite my papers a couple more times. And I think one of the things we got right launching the first few MOOCs and later building Coursera was putting in place that bedrock principle of let's just do what's best for learners and forget about everything else. And I think that as a guiding principle turned out to be really important to the rise of the MOOC movement.
And the kind of learner you imagined in your mind is as broad as possible, as global as possible. So really try to reach as many people interested in machine learning and AI as possible?
I really want to help anyone that had an interest in machine learning to break into the field. And I think sometimes I've actually had people ask me, hey, why are you spending so much time explaining gradient descent? And my answer was if I look at what I think the learner needs and would benefit from, I felt that having a good understanding of the foundations, kind of back to the basics, would put them in a better state to then build on a long-term career. So tried to consistently make decisions on that principle.
So, one of the things you actually revealed to the narrow AI community at the time and to the world is that the amount of people who are actually interested in AI is much larger than we imagined. By you teaching the class and how popular it became, it showed that wow, this isn't just a small community of sort of people who go to NeurIPS, and it's much bigger. It's developers. It's people from all over the world. I mean I'm Russian so everybody in Russia is really interested. There's a huge number of programmers who are interested in machine learning. India, China, South America, everywhere, there's just millions of people who are interested in machine learning. So how big do you get a sense that the number of people is that are interested from your perspective?
I think the number has grown over time. I think it's one of those things that maybe it feels like it came out of nowhere, but as an insider building it, it took years. It's one of those overnight successes that took years to get there.
My first foray into this type of online education was when we were filming my Stanford class and sticking the videos on YouTube and some other things. We had uploaded a whole and so on. But you know, basically the one hour fifteen minute video that we put on YouTube, and then we had four or five other versions of websites that I had built, most of which you would never have heard of because they reached small audiences, but that allowed me to iterate, allow my team and me to iterate to learn what are the ideas that work and what doesn't. For example, one of the features I was really excited about and really proud of was building this website where multiple people could be logged into the website at the same time. So today if you go to a website, you know, if you're logged in and then I want to log in, you need to log out if it's the same browser, same computer. But I thought, well, what if two people, say you and me, we're watching a video together in front of a computer. What if a website could have you type your name and password, have me type my name and password, and then now the computer knows both of us are watching together and it gives both of us credit for anything we do as a group. I even featured this at a high school in San Francisco. We had about twenty-something users, where's the teacher there, Sacred Heart Cathedral Prep, the teacher is great. And guess what? Zero people used this feature. It turns out people studying online, they want to watch the videos by themselves. You can play back, pause at your own speed rather than in groups. So that was one example of a tiny lesson learned out of many that allowed us to hone in to the set of features.
And it sounds like a brilliant feature. So I guess the lesson to take from that is you there's something that looks amazing on paper and then nobody uses it, doesn't actually have the impact that you think it might have. And so yeah, I saw that you really went through a lot of different features and a lot of ideas and to arrive at the final, at Coursera, the final kind of powerful thing that showed the world that MOOCs can educate millions.
And I think with the whole machine learning movement as well, I think it didn't come out of nowhere. Instead what happened was as more people learn about machine learning, they will tell their friends and their friends will see how it's applicable to their work and then the community kept on growing. And I think we're still growing. You know, I don't know in the future what percentage of all developers will be AI developers. I could easily see it being north of 50%. Right? Because so many AI developers broadly construed, not just people doing the machine learning modeling but the people building infrastructure, data pipelines, you know, all the software surrounding the core machine learning model, maybe is even bigger. I feel like today almost every software engineer has some understanding of the cloud. Not all, you know, but maybe this microcontroller developer doesn't need to deal with the cloud. But I feel like the vast majority of software engineers today sort of have an appreciation of cloud. I think in the future maybe we'll approach nearly 100% of all developers being you know in some way an AI developer or at least having an appreciation of machine learning. And my hope is that there's this kind of effect that there's people who are not really interested in being a programmer or being into software engineering, like biologists, chemists, and physicists, even mechanical engineers, all these disciplines that are now more and more sitting on large data sets. And here they didn't think they're interested in programming until they have this data set and they realize there's these set of machine learning tools that allow you to use the data set. So they actually become, they learn to program and they become new programmers. So not just because you've mentioned a larger percentage of developers become machine learning people, it seems like more and more the kinds of people who are becoming developers is also growing significantly.
Yeah. I think once upon a time only a small part of humanity was literate, you could read and write, and maybe you thought maybe not everyone needs to learn to read and write, you just go listen to a few monks, right? Read to you. And maybe that was enough. Or maybe just need a few handful of authors to write the bestsellers and then no one else needs to write. But what we found was that by giving as many people, you know, in some countries almost everyone basic literacy, it dramatically enhanced human-to-human communications and we can now write for an audience of one such as if I send you an email or you send me an email. I think in computing we're still in that phase where so few people know how to code that the coders mostly have to code for relatively large audiences. But if everyone or most people became developers at some level, similar to how most people in developed economies are somewhat literate, I would love to see the owners of a mom and pop store be able to write a little bit of code to customize the TV display for their special this week. Yeah, I think it'll enhance human-to-computer communications which is becoming more and more important today as well.
So you think it's possible that machine learning becomes kind of similar to literacy where, yeah, like you said, the owners of a mom and pop shop, basically everybody in all walks of life would have some degree of programming capability?
I could see society getting there. There's one other interesting thing, you know, if I go talk to the mom and pop store, if I talk to a lot of people in their daily professions, I previously didn't have a good story for why they should learn to code, you know, we could give them some reasons but what I found with the rise of machine learning and data science is that I think the number of people with a concrete use for data science in their daily lives, in their jobs, may be even larger than the number of people with a concrete use for software engineering. For example, if you run a small mom and pop store, I think if you can analyze the data about your sales, your customers, I think there's actually real value there, maybe even more than traditional software engineering. So I find that for a lot of my friends in various professions, be it recruiters or accountants or you know people that work in factories which I deal with more and more these days, I feel if they were data scientists at some level they could immediately use that in their work. So I think that data science and machine learning may be an even easier entry into the developer world for a lot of people than software engineering.
That's interesting and I agree with that but that's beautifully put. We live in a world where most courses and talks have slides, PowerPoint, Keynote, and yet you famously often still use a marker and a whiteboard. The simplicity of that is compelling and for me at least fun to watch. So let me ask, why do you like using a marker and whiteboard even on the biggest of stages?
I think it depends on the concepts you want to explain. For mathematical concepts it's nice you can build up the equation one piece at a time. And the whiteboard marker or the pen and stylus is a very easy way to build up an equation, build up a complex concept one piece at a time while you're talking about it, and sometimes that enhances understandability. The downside of writing is that it's slow and so if you want a long sentence it's very hard to write that so I think there are pros and cons and sometimes I use slides and sometimes I use a whiteboard or a stylus. The slowness of a whiteboard is also its upside because it forces you to reduce everything to the basics.
So some of your talks involve the whiteboard. I mean, there's really not, you go very slowly and you really focus on the most simple principles and that's a beautiful, that enforces a kind of minimalism of ideas that I think is surprising at least for me, is great for education. Like a great talk I think is not one that has a lot of content. A great talk is one that just clearly says a few simple ideas. And I think the whiteboard somehow enforces that. Pieter Abbeel, who's now one of the top roboticists and reinforcement learning experts in the world, was your first PhD student. So, I bring him up just because I kind of imagine this must have been an interesting time in your life. Do you have any favorite memories of working with Pieter? Your first student in those uncertain times, especially before deep learning really blew up. Any favorite memories from those times?
Yeah. I was really fortunate to have had Pieter Abbeel as my first PhD student. And I think even my long-term professional success builds on early foundations or early work that Pieter was so critical to. So, it was really grateful to him for working with me. You know, what not a lot of people know is just how hard research was and still is. Pieter's PhD thesis was using reinforcement learning to fly helicopters. And so, you know, actually even today the website heli.stanford.edu is still up. You can watch videos of us using reinforcement learning to make a helicopter fly upside down, fly loops, roses. It's cool.
It's one of the most incredible robotics videos ever. So, people should watch it.
Inspiring. That's from like 2008 or 2007 or 2006, like that range.
Something like that. It's like over 10 years old.
That was really inspiring to a lot of people.
Yes. What not many people see is how hard it was. So Pieter and Adam Coates and Morgan Quigley and I were working on various versions of the helicopter and a lot of things did not work. For example, turns out one of the hardest problems we had was when helicopters flying around upside down doing stunts, how do you figure out the position? How do you localize a helicopter? So we wanted to try all sorts of things. Having one GPS unit doesn't work because you're flying upside down. GPS unit is facing down so you can't see the satellites. So, we experimented trying to have two GPS units, one facing up, one facing down. So, if you flip over, that didn't work because the downward facing one couldn't synchronize if you're flipping quickly. Morgan Quigley was exploring this crazy complicated configuration of specialized hardware to interpret GPS signals, looking into FPGA, completely insane. Spent about a year working on that. Didn't work. So I remember Pieter, great guy, him and me, you know, sitting down in my office looking at some of the latest things we had tried that didn't work and saying, you know, darn it, like what now? Because we tried so many things and it just didn't work. In the end, what we did, and Adam Coates was crucial to this, was put cameras on the ground and use cameras on the ground to localize a helicopter, and that solved the localization problem, so that we could then focus on the reinforcement learning and inverse reinforcement learning techniques to then actually make the helicopter fly. And you know I'm reminded when I was doing this work at Stanford around that time there was a lot of reinforcement learning theoretical papers but not a lot of practical applications. So the autonomous helicopter work for flying helicopters was one of the few practical applications of reinforcement learning at the time which caused it to become pretty well-known. I feel like we might have almost come full circle where today there's so much buzz, so much hype, so much excitement about reinforcement learning, but again we're hunting for more applications of all of these great ideas that the community's come up with.
What was the drive sort of in the face of the fact that most people are doing theoretical work? What motivated you in the uncertainty and the challenges to get the helicopter sort of to do the applied work, to get the actual system to work? Yeah. In the face of fear, uncertainty, sort of the setbacks that you mentioned for localization.
I like stuff that works. In the physical world. So like it's back to the shredder. You know, I like theory, but when I work on theory myself, and this is personal taste. I'm not saying anyone else should do what I do, but when I work on theory, I personally enjoy it more if I feel that the work I do will influence people, have positive impact or help someone. I remember when many years ago, I was speaking with a mathematics professor and I just said, hey, why do you do what you do? And he actually, you know, he had stars in his eyes when he answered, and this mathematician, not from Stanford, different university, he said I do what I do because it helps me to discover truth and beauty in the universe.
He had stars in his eyes when he said that.
And I thought that's great. I don't want to do that. I think it's great that someone does that, fully support the people that do it, a lot of respect for people for that. But I am more motivated when I can see a line to how the work that my teams and I are doing helps people. The world needs all sorts of people. I'm just one type. I don't think everyone should do things the same way as I do. But when I delve into either theory or practice, if I personally have conviction, you know, that here's a pathway to help people, I find that more satisfying to have that conviction.
That's your path. Yeah. You were a proponent of deep learning before it gained widespread acceptance. What did you see in this field that gave you confidence? What was your thinking process like in that first decade of the, I don't know what that's called, 2000s?
Yeah I can tell you the thing we got wrong and the thing we got right. The thing we really got wrong was the importance of, the early importance of unsupervised learning. So early days of Google Brain we put a lot of effort into unsupervised learning rather than supervised learning. And there was this argument actually I think it was around 2005 after, you know, NeurIPS at that time called NIPS but now NeurIPS had ended and Jeff Hinton and I were sitting in the cafeteria outside, you know, the conference we had lunch, we were just chatting, and Jeff pulled up this napkin, he started sketching this argument on a napkin. It was very compelling. I'll repeat it. Human brain has about 100 trillion, so that's 10 to the 14, synaptic connections. You will live for about 10 to the 9 seconds, that's 30 years. You actually live for two by 10 to the 9, maybe three by 10 to the 9 seconds. So just let's say 10 to the 9. So if each synaptic connection, each weight in your brain, your network, has just a one bit parameter, that's 10 to the 14 bits you need to learn in up to 10 to the 9 seconds of your life. So via this simple argument, which like a lot of problems is very simplified, that's 10 to the 5 bits per second you need to learn in your life. And I have a one-year-old daughter. I am not pointing out 10 to the 5 bits per second of labels to her. So, and I think I'm a very loving parent, but I'm just not going to do that, right? So from this, you know, very crude, definitely problematic argument, there's just no way that most of what we know is through supervised learning. But where you could get so many bits of information is from sucking in images, audio, just experiences in the world. And so that argument, and there are a lot of nuances to the argument, you know, we should go into, really convinced me that there's a lot of power to unsupervised learning. So that was the part that we actually maybe got wrong. I still think unsupervised learning is really important, but in the early days, you know, 10, 15 years ago, a lot of us thought that was the path forward.
Oh so you're saying that perhaps was the wrong intuition for the time.
For the time, that was the part we got wrong. The part we got right was the importance of scale. So Adam Coates, another wonderful person fortunate to have worked with him. He was in my group at Stanford at the time and Adam had run these experiments at Stanford showing that the bigger we trained a learning algorithm, the better his performance. And it was based on that, there was a graph that Adam generated, you know, where the x-axis, y-axis, lines going up and to the right, bigger make this thing the better performance, accuracy is a vertical axis. So it's really based on that chart that Adam generated that he gave me the conviction that we could scale these models way bigger than what we could on the CPUs, which is what we had at Stanford, that we could get even better results. And it was really based on that one figure that Adam generated that gave me the conviction to go with Sebastian Thrun to pitch, you know, starting a project at Google, which became the Google Brain project.
Google Brain. You go found Google Brain, and there the intuition was scale will bring performance for the system. So we should chase larger and larger scale, and I think people don't realize how groundbreaking, it's simple but it's a groundbreaking idea that bigger data sets will result in better performance.
It was controversial at the time. Some of my well-meaning friends, you know, senior people in the machine learning community, I won't name, but people some of whom we know. My well-meaning friends came and were trying to give me friendly warnings like, hey Andrew why are you doing this? This is crazy. Look at these architectures are building. You just want to go for scale? Like this is a bad career move. So, so my well-meaning friends, you know, were trying, some of them were trying to talk me out of it. But I find that if you want to make a breakthrough, you sometimes have to have conviction and do something before it's popular, since that lets you have a bigger impact.
Let me ask you just on a small tangent on that topic. I find myself arguing with people saying that greater scale, especially in the context of active learning, so very carefully selecting the data set but growing the scale of the data set, is going to lead to even further breakthroughs in deep learning. And there's currently pushback at that idea that larger data sets are no longer, that so you want to increase the efficiency of learning, you want to make better learning mechanisms. And I personally believe that just bigger data sets will still, with the same learning methods we have now, will result in better performance. What's your intuition at this time on those, on this dual side, is do we need to come up with better architectures for learning or can we just get bigger, better data sets that will improve performance?
I think both are important and it's also problem dependent. So for a few data sets we may be approaching, you know, Bayes error rate, or approaching or surpassing human level performance, and then there's that theoretical ceiling that we will never surpass a Bayes error rate. But then I think there are plenty of problems where we're still quite far from either human level performance or from Bayes error rate, and bigger data sets with neural networks, without further algorithm innovation, will be sufficient to take us further. But on the flip side if we look at the recent breakthroughs using, you know, transformer networks or language models, it was a combination of novel architecture, but also scale had a lot to do with it. If we look at what happened with GPT-2 and BERT, I think scale was a large part of the story.
Yeah, that's not often talked about, is the scale of the data set it was trained on and the quality of the data set because there's some, so it was like Reddit threads that had, they were upvoted highly, so there's already some weak supervision on a very large data set that people don't often talk about, right?
Right. I find that today we have maturing processes to managing code, things like Git, right, version control. It took us a long time to evolve the good processes. I remember when my friends and I were emailing each other C++ files in email, you know, but then we had, was it CVS, version control, get maybe something else in the future. We're very immature in terms of tools for managing data and think of how to clean data and how to solve very messy data problems. I think there's a lot of innovation there to be had still.
I love the idea that you were versioning through email.
I'll give you one example. When we work with manufacturing companies, it's not at all uncommon for there to be multiple labelers that disagree with each other, right? And so doing the work in visual inspection, we would, you know, take say a plastic part and show it to one inspector, and the inspector, sometimes very opinionated, they go, clearly that's a defect, this scratch, unacceptable, got to reject this part. Take the same part to different inspector, different, very opinionated. Clearly the scratch is small, it's fine, don't throw it away, you're going to make us lose money. And then sometimes you take the same plastic part, show it to the same inspector in the afternoon as opposed to the morning, and very confidently, in the morning they say clearly it's okay, in the afternoon equally confident, clearly this is a defect. And so what is an AI team supposed to do if sometimes even one person doesn't agree with himself or herself in the span of a day? So I think these are the types of very practical, very messy data problems that my teams wrestle with. In the case of large consumer internet companies where you have a billion users, you have a lot of data, you don't worry about it. Just take the average, it kind of works. But in a case of other industry settings, we don't have big data. If just small data, very small data sets, maybe on a hundred defective parts or a hundred examples of a defect. If you have only a hundred examples, these little labeling errors, you know, if ten of your hundred labels are wrong, that actually is ten percent of your data set, has a big impact. So, how do you clean this up? What are you supposed to do? This is an example of the types of things that my teams, this is a Landing AI example, are wrestling with to deal with small data, which comes up all the time once you're outside consumer internet.
Yeah, that's fascinating. And so then you invest more effort and time in thinking about the actual labeling process, what are the labels, how are disagreements resolved, and all those kinds of pragmatic real world problems. That's a fascinating space.
Yeah. I find it actually when I'm teaching at Stanford, I increasingly encourage students at Stanford to try to find their own project for the end of term project, rather than just downloading someone else's nicely clean data set. It's actually much harder if you need to go find your own problem and find your own data set rather than you go to one of the several good websites, very good websites with clean scoped data sets that you could just work on.
You're now running three efforts. The AI Fund, Landing AI, and DeepLearning.AI. As you've said, the AI Fund is involved in creating new companies from scratch. Landing AI is involved in helping already established companies do AI, and DeepLearning.AI is for education of everyone else, or of individuals interested in getting into the field and excelling in it. So, let's perhaps talk about each of these areas. First, DeepLearning.AI. How, the basic question, how does a person interested in deep learning get started in the field? DeepLearning.AI is working to create courses to help people break into AI. So my machine learning course that I taught through Stanford remains one of the most popular courses on Coursera to this day. It's probably one of the courses sort of if I ask somebody how did you get into machine learning or how did you fall in love with machine learning or what got you interested, that it always goes back to Andrew at some point. So you've influenced the amount of people you've influenced is ridiculous. So for that I'm sure I speak for a lot of people, say big thank you.
No. Yeah. Thank you. You know, I was once reading a news article, I think it was Tech Review, and I'm going to mess up the statistic, but I remember reading an article that said something like one-third of all programmers are self-taught. I may have the number one-third around, maybe it was two-thirds, but when I read that article, I thought this doesn't make sense. Everyone is self-taught. Because you teach yourself, I don't teach people. I just don't.
That's well put. So, how does one get started in deep learning and where does DeepLearning.AI fit into that?
So the Deep Learning Specialization offered by DeepLearning.AI is, I think, one, it was Coursera's top specialization. It might still be. So it's a very popular way for people to take that specialization to learn about everything from neural networks to how to tune your network to what is a CNN, to what is an RNN or sequence model, or what is an attention model. And so the Deep Learning Specialization steps everyone through those algorithms so you deeply understand it and can implement it and use it for whatever application, from the very beginning.
So what would you say are the prerequisites for somebody to take the Deep Learning Specialization in terms of maybe math or programming background?
Yeah, need to understand basic programming since there are programming exercises in Python. And the math prereq is quite basic. So no calculus is needed. If you know calculus, it's great, you get better intuitions. But I deliberately tried to teach that specialization without requiring calculus. So I think high school math would be sufficient. If you know how to multiply two matrices, I think that's great.
So a little basic linear algebra is great.
Basic linear algebra, even very, very basic linear algebra and some programming. I think that people that have done the machine learning course will find the Deep Learning Specialization a bit easier, but it's also possible to jump into the Deep Learning Specialization directly, but it'll be a little bit harder since we tend to, you know, go over faster concepts like how does gradient descent work and what is an objective function, which is covered more slowly in the machine learning course.
Could you briefly mention some of the key concepts in deep learning that students should learn that you envision them learning in the first few months, in the first year or so?
So if you take the Deep Learning Specialization, you learn the foundations of what is a neural network, how do you build up a neural network from a, you know, single logistic unit to a stack of layers to different activation functions, you learn how to train the neural networks. One thing I'm very proud of in that specialization is we go through a lot of practical know-how of how to actually make these things work. So what are the differences between different optimization algorithms? What do you do if the algorithm overfits or how do you tell if the algorithm is overfitting? When do you collect more data? When should you not bother to collect more data? I find that even today unfortunately there are engineers that will spend six months trying to pursue a particular direction such as collect more data because we heard more data is valuable. But sometimes you could run some tests and could have figured out six months earlier that for this particular problem collecting more data isn't going to cut it. So just don't spend six months collecting more data, spend your time modifying the architecture or trying something else. So it goes through a lot of the practical know-how so that when you take the Deep Learning Specialization you have those skills to be very efficient in how you build these networks, to dive right in to play with the network, to train it, to do the inference on a particular data set, to build the intuition about it without building it up too big to where you spend like you said six months learning, building up your big project without building any intuition of a small aspect of the data that could already tell you everything you need to know about that data.
And also the systematic frameworks of thinking for how to go about building practical machine learning. Maybe to make an analogy, when we learn to code, we have to learn the syntax of some programming language, right? Be it Python or C++ or Octave or whatever. But the equally important or maybe even more important part of coding is to understand how to string together these lines of code into coherent things. So you know when should you put something in a function call and when should you not? How do you think about abstraction? So those frameworks are what makes a programmer efficient even more than understanding the syntax. I remember when I was in undergrad at Carnegie Mellon, one of my friends would debug their code by first trying to compile it, and then it was C++ code, and then every line that is a syntax error, they want to get rid of syntax errors as quickly as possible. So how do you do that? Well, they would delete every single line of code with a syntax error. So really efficient for getting rid of syntax errors but horrible debugging services. So we learned how to debug. And I think in machine learning the way you debug a machine learning program is very different than the way you do binary search or whatever, use a debugger, trace through the code in traditional software engineering. So it is an evolving discipline but I find that the people that are really good at debugging machine learning algorithms are easily 10x, maybe 100x faster at getting something to work.
And the basic process of debugging is so the bug in this case, why isn't this thing learning, learning, improving, sort of going into the questions of overfitting and all those kinds of things, that's the logical space that the debugging is happening in with neural networks.
Yeah, often the question is why doesn't it work yet, or can I expect it to eventually work, and what are the things I could try: change the architecture, more data, more regularization, different optimization algorithm, you know, different types of data. So to answer those questions systematically so that you don't spend six months heading down a blind alley before someone comes and says why did you spend six months doing this.
What concepts in deep learning do you think students struggle the most with or sort of is the biggest challenge for them? Once they get over that hill, it hooks them and it inspires them and they really get it.
Similar to learning mathematics, I think one of the challenges of deep learning is that there are a lot of concepts that build on top of each other. If you ask me what's hard about mathematics, I have a hard time pinpointing one thing. Is it addition, subtraction, is it a carry? Is it multiplication? There's just a lot of stuff. I think one of the challenges of learning math and of learning certain technical fields is that there are a lot of concepts, and if you miss a concept then you're kind of missing the prerequisite for something that comes later. So in the Deep Learning Specialization, we try to break down the concepts to maximize the odds of each component being understandable. So when you move on to the more advanced thing, we learn convolution, you have confidence, hopefully you have enough intuitions from the earlier sections to then understand why we structure convolution in a certain way and then eventually why we build, you know, RNNs and LSTMs or attention model in a certain way, building on top of the earlier concepts.
Actually I'm curious, you do a lot of teaching as well. Do you have a favorite this is the hard concept moment in your teaching?
Well, I don't think anyone's ever turned the interview on me. I'm glad you go first.
I think that's a really good question. Yeah, it's really hard to capture the moment when they struggle. I think you put it really eloquently. I do think there's moments that are like aha moments that really inspire people. I think for some reason reinforcement learning, especially deep reinforcement learning, is a really great way to really inspire people and get what the use of neural networks can do. Even though neural networks really are just a part of the deep learning framework, but it's a really nice way to paint the entirety of the picture of a neural network being able to learn from scratch, knowing nothing and explore the world and pick up lessons. I find that a lot of the aha moments happen when you use deep RL to teach people about neural networks, which is counterintuitive. I find like a lot of the inspired sort of fire in people's passion, people's eyes comes from the RL world. Do you find reinforcement learning to be a useful part of the teaching process or no?
I still teach reinforcement learning in one of my Stanford classes. And my PhD thesis was on reinforcement learning. So, I clearly love the field. I find that if I'm trying to teach students the most useful techniques for them to use today, I end up shrinking the amount of time I talk about reinforcement learning. It's not what's working today. Now, our work changes so fast. Maybe this will be totally different in a couple years. But I think we need a couple more things for reinforcement learning to get there.
To actually get there. Yeah.
One of my teams is looking at reinforcement learning for some robotic control tasks. So I see the applications but if you look at it as a percentage of all of the impact of the types of things we do, is at least today outside of playing video games, right, and a few other games, the scope actually at NeurIPS a bunch of us were standing around saying hey what's your best example of an actual deployed reinforcement learning application, and you know among senior machine learning researchers, right, and again there are some emerging ones but there are not that many great examples.
Well, I think you're absolutely right. The sad thing is there hasn't been a big application, impactful real world application of reinforcement learning. I think its biggest impact to me has been in the toy domain, in the game domain, in the small example. That's what I mean for educational purpose. It seems to be a fun thing to explore neural networks with. But I think from your perspective, and I think that might be the best perspective, is if you're trying to educate with a simple example in order to illustrate how this can actually be grown to scale and have a real world impact, then perhaps focusing on the fundamentals of supervised learning in the context of, you know, a simple data set, even like an MNIST data set, is the right path to take. I just, the amount of fun I've seen
People have with reinforcement learning has been great, but not in the applied impact on the real world setting. So, it's a trade-off. How much impact you want to have versus how much fun you want to have.
Yeah, that's really cool. And I feel like, you know, the world actually needs all sorts. Even within machine learning, I feel like deep learning is so exciting, but AI team shouldn't just use deep learning. I find that my teams use a portfolio of tools. And maybe that's not the exciting thing to say, but some days we use a neural net. Some days we use PCA. Actually the other day I was sitting down with my team looking at PCA residuals trying to figure out what's going on with PCA applied to a manufacturing problem. And some days we use a probabilistic graphical model. Some days we use a knowledge graph, which is one of the things that has tremendous industry impact but the amount of chatter about knowledge graphs in academia is really thin compared to the actual raw impact. So, I think reinforcement learning should be in that portfolio and then it's about balancing how much we teach all of these things and the world should have diverse skills. It would be sad if, you know, everyone just learned one narrow thing.
Yeah. The diverse skill helps you discover the right tool for the job. What is the most beautiful, surprising, or inspiring idea in deep learning to you? Something that captivated your imagination. Is it the scale that could be achieved, the performance that could be achieved with scale, or is there other ideas?
I think that if my only job was being an academic researcher, if an unlimited budget and, you know, didn't have to worry about short-term impact and only focused on long-term impact, I probably spent all my time doing research on unsupervised learning. I still think unsupervised learning is a beautiful idea. At both this past NeurIPS and ICML, I was attending workshops or listening to various talks about self-supervised learning, which is one vertical segment maybe of sort of unsupervised learning that I'm excited about. Maybe just to summarize the idea, I guess, you know, the idea I'll describe briefly.
So here's an example of self-supervised learning. Let's say we grab a lot of unlabeled images off the internet. So we have infinite amounts of this type of data. I'm going to take each image and rotate it by a random multiple of 90 degrees. And then I'm going to train a supervised neural network to predict what was the original orientation. So has this been rotated 90, 180, 270, or 0 degrees. So you can generate an infinite amount of label data because you rotated the image so you know what's the ground truth label. And so various researchers have found that by taking unlabeled data and making up label data sets and training a large neural network on these tasks, you can then take the hidden layer representation and transfer it to a different task very powerfully. Learning word embeddings, where we take a sentence, delete a word, predict the missing word, which is how we learn, you know, one of the ways we learn word embeddings, is another example. And I think there's now this portfolio of techniques for generating these made-up tasks. Another one called jigsaw would be if you take an image, cut it up into a, you know, 3x3 grid. So like a nine 3x3 puzzle piece, jump out the nine pieces and have a neural network predict which of the nine factorial possible permutations it came from. So many groups, including, you know, OpenAI, FAIR has been doing some work on this too. Facebook, Google Brain, I think DeepMind, oh actually Aaron van den Oord has great work on the CPC objective. So many teams are doing exciting work and I think this is a way to generate infinite label data, and I find this a very exciting piece of unsupervised learning.
So long-term you think that's going to unlock a lot of power in machine learning systems, is this kind of unsupervised learning?
I don't think there's a whole enchilada. I think it's just a piece of it, and I think this one piece, these self-supervised learning, is starting to get traction. We're very close to it being useful. Well, word embeddings are really useful. I think we're getting closer and closer to this having a significant real world impact, maybe in computer vision and video. But I think this concept and I think there'll be other concepts around it. You know, other unsupervised learning things that I worked on, I've been excited about. I was really excited about sparse coding and slow feature analysis. I think all of these are ideas that various of us were working on about a decade ago before we all got distracted by how well supervised learning was working.
Yeah. So we would return to the fundamentals of representation learning that really started this movement of deep learning.
I think there's a lot more work that one could explore around this theme of ideas and other ideas to come up with better algorithms. So if we could return to, maybe talk quickly about the specifics of deep learning.ai, the deep learning specialization perhaps. How long does it take to complete the course, would you say?
The official length of the deep learning specialization is, I think, 16 weeks, so about 4 months, but it's go at your own pace. So if you subscribe to the deep learning specialization, there are people that finished it in less than a month by working more intensely and studying more intensely. It really depends on the individual. Yeah. When we created the deep learning specialization, we wanted to make it very accessible and very affordable. And with, you know, Coursera and deeplearning.ai education mission, one of the things that's really important to me is that if there's someone for whom paying anything is a financial hardship, then just apply for financial aid and get it for free.
If you were to recommend a daily schedule for people in learning, whether it's through the deep learning specialization or just learning in the world of deep learning, what would you recommend? How do they go about day-to-day, sort of specific advice about learning, about their journey in the world of deep learning and machine learning?