1 00:00:00,000 --> 00:00:02,010 2 00:00:02,010 --> 00:00:03,010 SPEAKER 1: Hello, world. 3 00:00:03,010 --> 00:00:05,310 This is the CS50X x educator workshop. 4 00:00:05,310 --> 00:00:07,860 Can everyone hear me OK? 5 00:00:07,860 --> 00:00:08,510 Amazing. 6 00:00:08,510 --> 00:00:12,850 So this is our last day together, at least for the workshop in particular. 7 00:00:12,850 --> 00:00:15,030 We'll be joined, of course with CSF CS50s own Brian 8 00:00:15,030 --> 00:00:23,280 Yew on CS50s introduction to Artificial Intelligence with Python. 9 00:00:23,280 --> 00:00:25,830 This, of course, is our newest class, all thanks to Brian. 10 00:00:25,830 --> 00:00:28,140 And it is another follow on class that students 11 00:00:28,140 --> 00:00:32,250 can take after completing a class like CS50x itself. 12 00:00:32,250 --> 00:00:36,840 Before we dive in, would anyone like to say a friendly hello on camera? 13 00:00:36,840 --> 00:00:39,870 And feel free, as always, to chime in on the chat 14 00:00:39,870 --> 00:00:43,310 by telling folks where in the world you are. 15 00:00:43,310 --> 00:00:45,810 Amad, can we start with you? 16 00:00:45,810 --> 00:00:50,670 AMAD: As usual, I'd like to say hello to everyone at the end of the week, 17 00:00:50,670 --> 00:00:53,490 wishing them a great weekend. 18 00:00:53,490 --> 00:01:01,010 And a special thank you for this great workshop, Dave, Brian, Margaret, 19 00:01:01,010 --> 00:01:03,590 Kareem, everyone who was working in CS50. 20 00:01:03,590 --> 00:01:06,920 21 00:01:06,920 --> 00:01:11,730 I do rarely get inspired by anyone, but I am greatly inspired by you guys. 22 00:01:11,730 --> 00:01:12,690 Thank you very much. 23 00:01:12,690 --> 00:01:15,950 And thank you for everyone who joined. 24 00:01:15,950 --> 00:01:18,420 Their comments is very valuable to me. 25 00:01:18,420 --> 00:01:21,370 I saved the chat and I learned a lot from it. 26 00:01:21,370 --> 00:01:22,470 So thank you. 27 00:01:22,470 --> 00:01:23,940 Enjoy your workshop. 28 00:01:23,940 --> 00:01:26,475 I'm looking forward to working with all of you. 29 00:01:26,475 --> 00:01:29,600 SPEAKER 1: Wonderful, thank you for the kind words, and for the whole group 30 00:01:29,600 --> 00:01:30,400 as well. 31 00:01:30,400 --> 00:01:33,780 Andreas, would you like to say hello as well? 32 00:01:33,780 --> 00:01:36,915 ANDREAS: Hello, [INAUDIBLE] professor [INAUDIBLE].. 33 00:01:36,915 --> 00:01:42,950 And those in the workshop goals also [INAUDIBLE] Russia. 34 00:01:42,950 --> 00:01:45,670 And I'm very glad that I was here. 35 00:01:45,670 --> 00:01:47,550 So thank you. 36 00:01:47,550 --> 00:01:48,590 SPEAKER 1: Very welcome. 37 00:01:48,590 --> 00:01:50,370 Welcome, again. 38 00:01:50,370 --> 00:01:51,270 [INAUDIBLE]? 39 00:01:51,270 --> 00:01:53,100 SPEAKER 2: Thank you very much. 40 00:01:53,100 --> 00:01:56,820 [INAUDIBLE] first let me congratulate you on this model 41 00:01:56,820 --> 00:02:01,920 that you have provided for the teachers and especially for its content. 42 00:02:01,920 --> 00:02:06,270 I can see they're very valuable as I have said before in previous lecture. 43 00:02:06,270 --> 00:02:11,160 I also really appreciate the lecture, starting with you, Professor David. 44 00:02:11,160 --> 00:02:17,130 And further with Professor Margaret, Brian, Kareem, Colton, 45 00:02:17,130 --> 00:02:20,140 sorry if I've forgotten anyone. 46 00:02:20,140 --> 00:02:26,040 [INAUDIBLE] that you practice and that you offer during this workshop I 47 00:02:26,040 --> 00:02:33,360 see as very valuable to adapt, as Amad said in prior, to our teaching work. 48 00:02:33,360 --> 00:02:38,070 I had the opportunity, as I told you, to complete the technology 49 00:02:38,070 --> 00:02:40,860 courses at your university previously. 50 00:02:40,860 --> 00:02:44,530 And I tried to figure out how some of these models work. 51 00:02:44,530 --> 00:02:48,120 Finally, I would like to express my sincere appreciation 52 00:02:48,120 --> 00:02:52,740 for the way the lectures are organized and for interactive communication 53 00:02:52,740 --> 00:02:54,210 during these lecture. 54 00:02:54,210 --> 00:02:59,800 Especially question and answer with professors. 55 00:02:59,800 --> 00:03:02,780 And thank you for being part of this course, David. 56 00:03:02,780 --> 00:03:05,970 SPEAKER 1: Oh, well thank you as well for being part of the whole experience 57 00:03:05,970 --> 00:03:08,070 this past week and beyond. 58 00:03:08,070 --> 00:03:09,460 Glad to have you back. 59 00:03:09,460 --> 00:03:10,290 Abashek? 60 00:03:10,290 --> 00:03:12,060 Would you like to say hi to the group? 61 00:03:12,060 --> 00:03:14,590 ABASHEK: It was amazing event time. 62 00:03:14,590 --> 00:03:16,520 I dearly loved each session. 63 00:03:16,520 --> 00:03:21,960 And thanks for hosting in due time, so it's like 9:30 now in India. 64 00:03:21,960 --> 00:03:25,770 And many times I used to do some other work in the night, 65 00:03:25,770 --> 00:03:29,490 so I still try to join in the early mornings, 7:30 AM in India. 66 00:03:29,490 --> 00:03:33,310 So this was really good, and all of you were amazing. 67 00:03:33,310 --> 00:03:37,380 I just tried CS50x [INAUDIBLE] introduction 68 00:03:37,380 --> 00:03:39,180 to computer programming background. 69 00:03:39,180 --> 00:03:42,120 By now I want to try all that also. 70 00:03:42,120 --> 00:03:44,930 Especially today's session, I'm really waiting. 71 00:03:44,930 --> 00:03:46,480 And it was amazing. 72 00:03:46,480 --> 00:03:50,640 I'm missing that this is not a physical workshop. 73 00:03:50,640 --> 00:03:53,640 But nevertheless, the virtual workshop was amazing. 74 00:03:53,640 --> 00:03:56,480 And thanks a lot, even [INAUDIBLE],, you were amazing. 75 00:03:56,480 --> 00:03:58,140 [INAUDIBLE] 76 00:03:58,140 --> 00:04:00,690 Thanks a lot, David. 77 00:04:00,690 --> 00:04:03,840 Hope to see you again in such events online now 78 00:04:03,840 --> 00:04:06,480 that the world has become very small because of COVID. 79 00:04:06,480 --> 00:04:07,558 Thank you. 80 00:04:07,558 --> 00:04:08,850 SPEAKER 1: You're very welcome. 81 00:04:08,850 --> 00:04:10,050 Thank you. 82 00:04:10,050 --> 00:04:12,460 Angela, would you like to say hello? 83 00:04:12,460 --> 00:04:13,910 ANGELA: I think-- 84 00:04:13,910 --> 00:04:17,010 Please excuse my kitchen, OK? 85 00:04:17,010 --> 00:04:20,079 I think it's really wonderful to have gone through all of these 86 00:04:20,079 --> 00:04:25,200 and have a conceptual understanding of what each course offered. 87 00:04:25,200 --> 00:04:28,470 I originally thought one thing and then I went back and forth, 88 00:04:28,470 --> 00:04:32,700 because I've really gained an understanding of what all of that 89 00:04:32,700 --> 00:04:33,480 means. 90 00:04:33,480 --> 00:04:36,900 And you're going to change my life and many of my students 91 00:04:36,900 --> 00:04:39,240 lives because of my understanding. 92 00:04:39,240 --> 00:04:42,900 And so thank you, because this is going to be super helpful. 93 00:04:42,900 --> 00:04:48,480 And we're all excited to be able to participate in the before classes 94 00:04:48,480 --> 00:04:51,760 as well as the after CS50x classes. 95 00:04:51,760 --> 00:04:53,360 And that is what has happened. 96 00:04:53,360 --> 00:04:54,358 So thank you very much. 97 00:04:54,358 --> 00:04:56,400 SPEAKER 1: Well, thank you, It's great to see you 98 00:04:56,400 --> 00:05:00,460 again and do continue to stay in touch, however we can be helpful. 99 00:05:00,460 --> 00:05:02,600 Fareed, over to you? 100 00:05:02,600 --> 00:05:03,600 FAREED: Hi, David. 101 00:05:03,600 --> 00:05:08,670 I just want to say thank you to you, Brian, oh, AJ, and everybody 102 00:05:08,670 --> 00:05:11,220 in the back end that was really, really. 103 00:05:11,220 --> 00:05:13,110 Because we just see those two weeks, but we 104 00:05:13,110 --> 00:05:15,240 don't know how many months went into this. 105 00:05:15,240 --> 00:05:20,640 So we appreciate it and we definitely want to continue on this. 106 00:05:20,640 --> 00:05:22,190 SPEAKER 1: Thank you as well. 107 00:05:22,190 --> 00:05:24,180 And indeed, behind the scenes is a whole team. 108 00:05:24,180 --> 00:05:28,410 Ian and Tara and Andrew and Rongshin and Arturo. 109 00:05:28,410 --> 00:05:31,830 And even more of CS50s team have been involved behind the scenes. 110 00:05:31,830 --> 00:05:35,960 Ramon as well, you might recall hearing from over email before this all began. 111 00:05:35,960 --> 00:05:38,650 Sylvana, would you like to say hello to the group? 112 00:05:38,650 --> 00:05:41,880 SYLVANA: Yes, Sylvana from Brazil. 113 00:05:41,880 --> 00:05:46,260 Hello Brian, hello David, hello all colleagues. 114 00:05:46,260 --> 00:05:51,600 I want to share with you my enthusiasm about this workshop. 115 00:05:51,600 --> 00:06:00,840 And first of all, I would like thank you for these workshop and opportunity. 116 00:06:00,840 --> 00:06:04,780 This pandemic brings a lot of trouble and pain. 117 00:06:04,780 --> 00:06:08,550 But at the same time, bring us some opportunities 118 00:06:08,550 --> 00:06:16,230 like that that wouldn't be possible if it was a [INAUDIBLE].. 119 00:06:16,230 --> 00:06:24,510 And I work with quality management, and daily I see a lot of opportunities 120 00:06:24,510 --> 00:06:28,080 to use technology to improve the quality. 121 00:06:28,080 --> 00:06:34,380 And I think it will free people from repetitive work 122 00:06:34,380 --> 00:06:40,710 to work with more challenging jobs. 123 00:06:40,710 --> 00:06:42,100 But there is a risk. 124 00:06:42,100 --> 00:06:46,850 If people can't manage it, the technology. 125 00:06:46,850 --> 00:06:54,580 And like any other quality professional, I hate to waste. 126 00:06:54,580 --> 00:07:00,930 And you have these wonderful material that's ready and available to us. 127 00:07:00,930 --> 00:07:11,950 Then I want to join my Brazilian colleagues, Ramon and Ignacio, that 128 00:07:11,950 --> 00:07:20,220 is participating in this workshop, and translate the material into Portuguese 129 00:07:20,220 --> 00:07:31,920 to bring it to more than 200 million people that spoke Portuguese. 130 00:07:31,920 --> 00:07:33,330 And it is that. 131 00:07:33,330 --> 00:07:34,740 Thank you a lot. 132 00:07:34,740 --> 00:07:39,730 I'm very honored participating in this workshop. 133 00:07:39,730 --> 00:07:41,440 SPEAKER 1: Oh, well so glad to have you. 134 00:07:41,440 --> 00:07:45,270 And so glad it will prove helpful for you and others as well. 135 00:07:45,270 --> 00:07:47,726 Ignacio, can we come to you next? 136 00:07:47,726 --> 00:07:54,960 IGNACIO: I would like to thank all the [INAUDIBLE] Brian, Kareem, Andreas, 137 00:07:54,960 --> 00:07:59,280 and everyone that I don't know yet. 138 00:07:59,280 --> 00:08:01,680 And I want to thank [INAUDIBLE] Sylvana for make sure 139 00:08:01,680 --> 00:08:06,820 that we are walking into translate the material that Ramon 140 00:08:06,820 --> 00:08:08,610 chose to start months ago. 141 00:08:08,610 --> 00:08:12,660 And we are enjoying in this [INAUDIBLE]. 142 00:08:12,660 --> 00:08:22,980 And I expect that I can use this material, from CS50, and maybe CS50 143 00:08:22,980 --> 00:08:36,080 [INAUDIBLE],, CS50 AI, well, [INAUDIBLE] to my students more significant meaning 144 00:08:36,080 --> 00:08:36,720 [INAUDIBLE]. 145 00:08:36,720 --> 00:08:37,600 Well is this. 146 00:08:37,600 --> 00:08:40,429 So thank you. 147 00:08:40,429 --> 00:08:43,240 It was two weeks. 148 00:08:43,240 --> 00:08:45,670 Very, very nice. 149 00:08:45,670 --> 00:08:48,010 And I got to join with you. 150 00:08:48,010 --> 00:08:48,625 Thank you. 151 00:08:48,625 --> 00:08:49,750 SPEAKER 1: Well, thank you. 152 00:08:49,750 --> 00:08:52,990 And we'll be sure to pass along everyone's thanks to Colton 153 00:08:52,990 --> 00:08:56,530 and Margaret and others, everyone who's been involved. 154 00:08:56,530 --> 00:08:57,240 Rampora. 155 00:08:57,240 --> 00:08:59,315 I was saving you and the family for last. 156 00:08:59,315 --> 00:09:00,440 If you'd like to say hello. 157 00:09:00,440 --> 00:09:06,870 RAMPORA: Yeah, thanks for the whole team of CS50 from my bottom of the heart. 158 00:09:06,870 --> 00:09:12,960 I congratulate and it has helped us a lot. 159 00:09:12,960 --> 00:09:17,580 Based on these interactions every day, so my son and my daughter 160 00:09:17,580 --> 00:09:19,500 has taken up CS50. 161 00:09:19,500 --> 00:09:23,250 And my son wants to talk to you for two minutes. 162 00:09:23,250 --> 00:09:24,195 SPEAKER 1: Hello. 163 00:09:24,195 --> 00:09:25,983 SPEAKER 3: Hi, hi, David. 164 00:09:25,983 --> 00:09:27,150 SPEAKER 1: Nice to meet you. 165 00:09:27,150 --> 00:09:28,680 What's your name? 166 00:09:28,680 --> 00:09:30,330 SPEAKER 2: My name is [INAUDIBLE]. 167 00:09:30,330 --> 00:09:34,360 By seeing the CS50 course [INAUDIBLE]. 168 00:09:34,360 --> 00:09:37,800 SPEAKER 1: Nice, and you're all done with that one? 169 00:09:37,800 --> 00:09:40,830 Are you going to take CS50x next with your dad? 170 00:09:40,830 --> 00:09:41,880 RAMPORA: Yes. 171 00:09:41,880 --> 00:09:44,001 SPEAKER 2: OK, yeah. 172 00:09:44,001 --> 00:09:45,750 SPEAKER 1: Glad you're so enthusiastic. 173 00:09:45,750 --> 00:09:48,198 RAMPORA: Yeah, thank you, thank you for the whole team. 174 00:09:48,198 --> 00:09:50,490 SPEAKER 1: Yeah, well he has a wonderful teacher there, 175 00:09:50,490 --> 00:09:53,190 I'm sure, to help him through all the bugs and challenges. 176 00:09:53,190 --> 00:09:55,080 RAMPORA: We'll do that, we'll do that, yeah. 177 00:09:55,080 --> 00:09:56,800 SPEAKER 1: Wonderful, welcome back. 178 00:09:56,800 --> 00:10:00,090 We're so glad everyone's joined us one final time. 179 00:10:00,090 --> 00:10:02,490 Please do keep in touch after this session and this week. 180 00:10:02,490 --> 00:10:04,930 We, of course, will follow up by email and the like 181 00:10:04,930 --> 00:10:08,090 to stay in touch as well as with resources and beyond. 182 00:10:08,090 --> 00:10:13,410 Today we conclude the workshop with a look at CS50 AI, or CS50's introduction 183 00:10:13,410 --> 00:10:19,380 to Artificial Intelligence with Python, led by CS50s own Brian Yew. 184 00:10:19,380 --> 00:10:22,540 What I find is especially compelling about this particular class which 185 00:10:22,540 --> 00:10:26,400 is CS50s and Brian's newest is that it offers an introduction 186 00:10:26,400 --> 00:10:30,750 to artificial intelligence without all of the prerequisites that are generally 187 00:10:30,750 --> 00:10:32,920 characteristic of courses in the space. 188 00:10:32,920 --> 00:10:36,060 And indeed, Brian teaches along the way, most everything a student 189 00:10:36,060 --> 00:10:37,200 would need to know. 190 00:10:37,200 --> 00:10:42,210 So without further ado and for one final time, Brian. 191 00:10:42,210 --> 00:10:43,860 BRIAN YEW: Thanks very much. 192 00:10:43,860 --> 00:10:44,830 Hi everyone. 193 00:10:44,830 --> 00:10:47,100 So glad to see you all here, and especially 194 00:10:47,100 --> 00:10:49,890 for everyone who's been with us throughout this whole workshop 195 00:10:49,890 --> 00:10:51,900 and to the new faces here as well. 196 00:10:51,900 --> 00:10:55,740 Very excited today to talk to you all about CS50s introduction 197 00:10:55,740 --> 00:10:58,260 to Artificial Intelligence with Python. 198 00:10:58,260 --> 00:11:01,530 There were a couple of guiding ideas behind this new course. 199 00:11:01,530 --> 00:11:03,630 And it is new, we just recorded all the lectures 200 00:11:03,630 --> 00:11:06,350 over the course of the past several months. 201 00:11:06,350 --> 00:11:11,430 And it only recently became available as OpenCourseWare and available on EdX. 202 00:11:11,430 --> 00:11:15,060 I'd say that the first of the big guiding principles of the course, 203 00:11:15,060 --> 00:11:17,310 as David alluded to, is that it's a course that's 204 00:11:17,310 --> 00:11:18,685 designed to be accessible. 205 00:11:18,685 --> 00:11:21,810 And in particular, it's designed to be mathematically accessible for people 206 00:11:21,810 --> 00:11:25,770 that might not have a whole lot of formal mathematics as their background. 207 00:11:25,770 --> 00:11:28,080 A lot of artificial intelligence nowadays 208 00:11:28,080 --> 00:11:31,892 has a lot to do with multi variable calculus and linear algebra, 209 00:11:31,892 --> 00:11:33,600 there's a lot of higher level math that's 210 00:11:33,600 --> 00:11:37,290 required to do a lot of the more sophisticated work 211 00:11:37,290 --> 00:11:38,610 in artificial intelligence. 212 00:11:38,610 --> 00:11:43,080 And therefore, assumed background for a lot of artificial intelligence courses. 213 00:11:43,080 --> 00:11:47,280 With this class, we certainly do assume some mathematical familiarity. 214 00:11:47,280 --> 00:11:49,890 Familiarity with mathematics to the level of CS50 215 00:11:49,890 --> 00:11:54,690 and comfortability with algebra and fractions and a little bit of geometry 216 00:11:54,690 --> 00:11:55,770 is helpful. 217 00:11:55,770 --> 00:11:59,520 But ultimately, we're not assuming things like calculus or linear algebra. 218 00:11:59,520 --> 00:12:03,180 And as topics do come up that are a little bit more mathematical in nature, 219 00:12:03,180 --> 00:12:07,530 things like formal logic or things like probability and statistics, 220 00:12:07,530 --> 00:12:10,100 we introduce those topics in the class itself, 221 00:12:10,100 --> 00:12:12,600 so that even students who haven't seen that kind of material 222 00:12:12,600 --> 00:12:16,263 before can still find it accessible. 223 00:12:16,263 --> 00:12:18,180 Another of the guiding principles of the class 224 00:12:18,180 --> 00:12:20,830 is that it's designed to be very practical. 225 00:12:20,830 --> 00:12:24,510 We introduce, in the lectures, a number of different algorithms and ideas. 226 00:12:24,510 --> 00:12:26,760 And then through projects, students actually 227 00:12:26,760 --> 00:12:29,170 write code to implement these algorithms. 228 00:12:29,170 --> 00:12:31,670 And we thought that was a really important part of the class 229 00:12:31,670 --> 00:12:34,050 too, to enable students not only to learn 230 00:12:34,050 --> 00:12:36,180 about the theory behind artificial intelligence 231 00:12:36,180 --> 00:12:39,360 and how it works, which is interesting and useful knowledge. 232 00:12:39,360 --> 00:12:43,770 But also then to be able to write code, to take advantage of existing packages 233 00:12:43,770 --> 00:12:47,130 and libraries that already exist out there for artificial intelligence 234 00:12:47,130 --> 00:12:51,270 and for machine learning, and to actually create something of their own. 235 00:12:51,270 --> 00:12:55,080 And then one of the final big ideas of the class, I would say, 236 00:12:55,080 --> 00:12:57,230 is that it's designed to be very broad. 237 00:12:57,230 --> 00:12:59,520 There is a lot of topics in artificial intelligence, 238 00:12:59,520 --> 00:13:04,350 far more than you could go into detail on everything inside of a single class. 239 00:13:04,350 --> 00:13:06,660 So while you could find classes out there 240 00:13:06,660 --> 00:13:10,140 that could spend an entire semester or yearlong course just diving 241 00:13:10,140 --> 00:13:15,180 into optimization problems or just diving into neural networks, 242 00:13:15,180 --> 00:13:18,390 we've taken the approach in this class of doing a broader introduction 243 00:13:18,390 --> 00:13:21,060 to a wider range of artificial intelligence topics, 244 00:13:21,060 --> 00:13:23,460 so that you leave the class with some exposure 245 00:13:23,460 --> 00:13:25,670 to a lot of different areas within AI. 246 00:13:25,670 --> 00:13:28,590 And students that are interested in one or more of those areas 247 00:13:28,590 --> 00:13:32,770 can then pursue those areas in a little bit more detail. 248 00:13:32,770 --> 00:13:35,070 So the course has been available online. 249 00:13:35,070 --> 00:13:37,530 And I would just be curious to hear if anyone has already 250 00:13:37,530 --> 00:13:39,620 taken a look at any of those materials. 251 00:13:39,620 --> 00:13:47,290 So I'm going to paste in, as I did before, a poll into the chat. 252 00:13:47,290 --> 00:13:50,023 If you could go ahead and fill out that poll. 253 00:13:50,023 --> 00:13:52,940 That's just going to ask you, have you looked at any of the materials? 254 00:13:52,940 --> 00:13:55,790 That is to say, ever looked at any of the lectures 255 00:13:55,790 --> 00:13:58,280 or ever taken a look at any of the projects, 256 00:13:58,280 --> 00:14:00,320 even if you haven't made it through everything. 257 00:14:00,320 --> 00:14:04,600 Just curious to see whether people have seen this material at all before. 258 00:14:04,600 --> 00:14:06,560 And that'll just help me with some context. 259 00:14:06,560 --> 00:14:09,980 Right now it looks like about, slightly more people, OK, more people 260 00:14:09,980 --> 00:14:12,120 that have not seen the material at all. 261 00:14:12,120 --> 00:14:13,760 Some people that certainly have. 262 00:14:13,760 --> 00:14:17,630 Regardless of which of these two categories you fall into, hopefully 263 00:14:17,630 --> 00:14:18,860 you'll learn something today. 264 00:14:18,860 --> 00:14:20,360 If you've never seen the material before, 265 00:14:20,360 --> 00:14:22,943 hopefully you'll get a sense for what the course is all about, 266 00:14:22,943 --> 00:14:25,485 the types of things we talk about and why we talk about them. 267 00:14:25,485 --> 00:14:27,526 And if you have seen the course, hopefully you'll 268 00:14:27,526 --> 00:14:30,535 get a better sense for the structure and the organization of the class 269 00:14:30,535 --> 00:14:32,660 and what we're hoping that students are getting out 270 00:14:32,660 --> 00:14:37,670 of each of the various different components of this class, too. 271 00:14:37,670 --> 00:14:41,240 All right, and there'll be another poll coming up later on today for you 272 00:14:41,240 --> 00:14:43,800 all to answer, if you would like to. 273 00:14:43,800 --> 00:14:46,250 So with that, let's go ahead and actually dive 274 00:14:46,250 --> 00:14:49,340 into the material of the AI course itself. 275 00:14:49,340 --> 00:14:52,400 And definitely, at any point today, if you have questions about anything 276 00:14:52,400 --> 00:14:56,600 that I'm talking about, definitely feel free to either raise your virtual hand 277 00:14:56,600 --> 00:14:58,160 if you'd like to ask a question. 278 00:14:58,160 --> 00:15:01,310 Or if you'd like to, you can also just type a message into the chat. 279 00:15:01,310 --> 00:15:05,070 I'm keeping an eye on both the raised hands as well as on the chat. 280 00:15:05,070 --> 00:15:07,530 So if you do have any questions about anything, 281 00:15:07,530 --> 00:15:11,540 feel free to use either of those means in order to get my attention. 282 00:15:11,540 --> 00:15:15,065 Thanks to Arturo for pasting the link to the slides into the chat as well. 283 00:15:15,065 --> 00:15:17,690 So if you'd like to take a look at those slides to follow along 284 00:15:17,690 --> 00:15:21,560 through what you're seeing here, you're welcome to look at those slides 285 00:15:21,560 --> 00:15:22,820 as well. 286 00:15:22,820 --> 00:15:25,460 All the material for the course syllabus, lectures, notes, 287 00:15:25,460 --> 00:15:31,338 projects and all, can be found at this URL here. cs50.harvard.edu/ai. 288 00:15:31,338 --> 00:15:34,130 And with that, let's go ahead and begin with a look at introduction 289 00:15:34,130 --> 00:15:36,288 to Artificial Intelligence with Python. 290 00:15:36,288 --> 00:15:38,580 And we're going to start by talking about the syllabus. 291 00:15:38,580 --> 00:15:43,130 So the course is divided into talking about seven major topics 292 00:15:43,130 --> 00:15:44,900 within artificial intelligence. 293 00:15:44,900 --> 00:15:46,820 And within each of those broader topics, we 294 00:15:46,820 --> 00:15:51,770 spend some detailed time talking about some of the algorithms and the ideas 295 00:15:51,770 --> 00:15:56,390 and the principles that are at the heart of modern artificial intelligence 296 00:15:56,390 --> 00:15:58,020 and machine learning. 297 00:15:58,020 --> 00:16:01,710 And the first of those broad topics is about search. 298 00:16:01,710 --> 00:16:04,020 In other words, we're trying to answer the question, 299 00:16:04,020 --> 00:16:08,690 how is it that artificial intelligence can search for solutions to problems? 300 00:16:08,690 --> 00:16:11,420 Because that's often what we want artificial intelligence to do. 301 00:16:11,420 --> 00:16:15,300 There is some problem that's difficult for humans to be able to solve, 302 00:16:15,300 --> 00:16:19,070 and we'd like for a computer to be able to solve that problem better 303 00:16:19,070 --> 00:16:21,500 than humans can solve that problem, or faster 304 00:16:21,500 --> 00:16:25,170 than humans can solve that problem, or maybe some combination of both. 305 00:16:25,170 --> 00:16:27,290 So what might those search problems look like? 306 00:16:27,290 --> 00:16:30,040 That's sort of where we begin to set the scene. 307 00:16:30,040 --> 00:16:32,210 A search problem might be something like a puzzle. 308 00:16:32,210 --> 00:16:33,960 If you've ever played with these little 15 309 00:16:33,960 --> 00:16:37,583 puzzles, which there used to be a CS50 problem set about this as well. 310 00:16:37,583 --> 00:16:39,500 Where you have these sliding tiles, and you're 311 00:16:39,500 --> 00:16:43,340 trying to line up all those tiles so that they number themselves from one 312 00:16:43,340 --> 00:16:44,690 all the way up to 15. 313 00:16:44,690 --> 00:16:48,020 That's a problem for which AI might want to look for a solution. 314 00:16:48,020 --> 00:16:50,270 In this case, the solution is something like, 315 00:16:50,270 --> 00:16:54,110 what is the right sequence of moves to take so that you end up 316 00:16:54,110 --> 00:16:56,990 in this, what we might call a goal state, 317 00:16:56,990 --> 00:17:00,617 where all the numbers are in the correct order. 318 00:17:00,617 --> 00:17:03,200 Another problem might be something like a maze, which we spend 319 00:17:03,200 --> 00:17:04,890 a lot of time looking in the AI class. 320 00:17:04,890 --> 00:17:06,680 You're starting from one place in the maze 321 00:17:06,680 --> 00:17:08,859 you're trying to get to the other side in the maze. 322 00:17:08,859 --> 00:17:12,109 At any particular location inside of this maze, 323 00:17:12,109 --> 00:17:15,260 there are particular actions that are available to you. 324 00:17:15,260 --> 00:17:17,030 And this might feel a little bit abstract, 325 00:17:17,030 --> 00:17:19,280 but you might translate it to the real world 326 00:17:19,280 --> 00:17:22,310 by considering something like driving directions on a map. 327 00:17:22,310 --> 00:17:27,230 If I'm trying to get from location one to location two on this map, 328 00:17:27,230 --> 00:17:29,210 well, I have certain roads that I can follow, 329 00:17:29,210 --> 00:17:31,490 I have certain turns I can make, different roads will 330 00:17:31,490 --> 00:17:33,890 take me different amounts of time to travel through. 331 00:17:33,890 --> 00:17:36,260 And so I might care about figuring out what 332 00:17:36,260 --> 00:17:40,220 is the best way to get from one location inside 333 00:17:40,220 --> 00:17:44,900 of this map to some other location on this map as well. 334 00:17:44,900 --> 00:17:47,930 And so one of the big ideas in artificial intelligence 335 00:17:47,930 --> 00:17:50,270 that we try to convey here from the very beginning 336 00:17:50,270 --> 00:17:54,830 is that we want to think about problems a little bit more abstractly. 337 00:17:54,830 --> 00:17:56,970 Rather than just thinking about the problem, 338 00:17:56,970 --> 00:17:59,540 how do I find my way through a maze, we want 339 00:17:59,540 --> 00:18:01,700 to realize that finding our way through the maze 340 00:18:01,700 --> 00:18:05,840 is a very similar problem to navigating our way through driving directions 341 00:18:05,840 --> 00:18:09,860 on a map, which is a very similar problem to solving that 15 sliding 342 00:18:09,860 --> 00:18:10,490 title puzzle. 343 00:18:10,490 --> 00:18:12,920 Even though they seem like very different contexts. 344 00:18:12,920 --> 00:18:16,010 In each of those situations, we have some current state 345 00:18:16,010 --> 00:18:19,250 of the world we're in, like where in the world we are or where in the puzzle 346 00:18:19,250 --> 00:18:20,090 we are. 347 00:18:20,090 --> 00:18:23,060 And we have some goal, some place we're trying to get to. 348 00:18:23,060 --> 00:18:25,880 And we have sequences of actions available to us 349 00:18:25,880 --> 00:18:29,030 that take us from one state to some other state. 350 00:18:29,030 --> 00:18:32,360 And once we start to think about all of these kinds of problems 351 00:18:32,360 --> 00:18:36,620 with a similar language, talking about goal states, where we currently are, 352 00:18:36,620 --> 00:18:39,290 what actions are available to us and so forth, 353 00:18:39,290 --> 00:18:42,010 we can start to come up with general purpose algorithms. 354 00:18:42,010 --> 00:18:45,810 Algorithms that are useful for solving these sorts of problems, 355 00:18:45,810 --> 00:18:49,200 and also a wider variety of problems that we haven't even talked about. 356 00:18:49,200 --> 00:18:52,490 And hopefully showing students how they can look at a new problem 357 00:18:52,490 --> 00:18:55,940 and try to figure out which algorithm might be applicable here, 358 00:18:55,940 --> 00:18:58,520 and what might be useful or relevant. 359 00:18:58,520 --> 00:19:02,550 So one of the first algorithms we talk about is depth-first search. 360 00:19:02,550 --> 00:19:05,540 And the idea of depth-first search, if unfamiliar with it, 361 00:19:05,540 --> 00:19:09,500 is in the context of solving a maze like this, for instance. 362 00:19:09,500 --> 00:19:13,220 Depth-first search is going to say like, just try one path through the maze, 363 00:19:13,220 --> 00:19:15,030 so you see if it works. 364 00:19:15,030 --> 00:19:17,150 And if it doesn't work, if you hit a dead end, 365 00:19:17,150 --> 00:19:20,537 then just go ahead and back up and try some other path. 366 00:19:20,537 --> 00:19:23,120 So a fairly straightforward algorithm, that hopefully everyone 367 00:19:23,120 --> 00:19:25,310 can intuitively understand, visually. 368 00:19:25,310 --> 00:19:26,340 Just try paths. 369 00:19:26,340 --> 00:19:28,413 And if they don't work, try something else. 370 00:19:28,413 --> 00:19:30,080 But then we try to formalize it as well. 371 00:19:30,080 --> 00:19:32,960 Putting things in terms of how might you actually write code 372 00:19:32,960 --> 00:19:34,290 in order to do this? 373 00:19:34,290 --> 00:19:37,160 What would the data structures look like if you're going to do this? 374 00:19:37,160 --> 00:19:40,070 We do assume a little bit of prior programming background, 375 00:19:40,070 --> 00:19:43,820 usually a year or more of programming in Python or some other programming 376 00:19:43,820 --> 00:19:44,570 language. 377 00:19:44,570 --> 00:19:47,390 All of the projects in this course are in Python 378 00:19:47,390 --> 00:19:51,050 so that students who have a little bit of prior Python background 379 00:19:51,050 --> 00:19:54,080 can apply what they know about lists and about sets 380 00:19:54,080 --> 00:19:57,830 and about functions in Python to each of these individual projects. 381 00:19:57,830 --> 00:20:01,280 But we have had students who didn't come in with prior Python experience, 382 00:20:01,280 --> 00:20:03,860 maybe came in with programming in a different language 383 00:20:03,860 --> 00:20:09,590 or some other mathematical background and ended up still 384 00:20:09,590 --> 00:20:12,530 being successful in the class by taking advantage 385 00:20:12,530 --> 00:20:17,030 of the resources and the sample code that we offer as part of the class. 386 00:20:17,030 --> 00:20:21,372 The class does not use R. So there are a number of possible languages 387 00:20:21,372 --> 00:20:23,330 in which you can do a lot of this kind of work. 388 00:20:23,330 --> 00:20:26,600 R is certainly a language that's very popular for data analysis and data 389 00:20:26,600 --> 00:20:27,680 science. 390 00:20:27,680 --> 00:20:30,345 Python is also good for these kinds of things, too. 391 00:20:30,345 --> 00:20:33,470 In terms of which to use, it comes down to a matter of personal preference. 392 00:20:33,470 --> 00:20:37,100 But Python ended up being a little better for this particular class. 393 00:20:37,100 --> 00:20:41,240 In part because of some of the libraries that are available 394 00:20:41,240 --> 00:20:45,680 and the really broad range of tooling that's available for Python. 395 00:20:45,680 --> 00:20:49,100 It allows us to be able to create graphical games for some 396 00:20:49,100 --> 00:20:49,850 of the projects. 397 00:20:49,850 --> 00:20:54,680 And it allows us to take advantage of a lot of the Python data analysis 398 00:20:54,680 --> 00:20:58,760 and machine learning libraries that are available and quite popular as well. 399 00:20:58,760 --> 00:21:02,700 Certainly, you could imagine doing a lot of this in other languages as well. 400 00:21:02,700 --> 00:21:05,570 And one of the principles in the lectures 401 00:21:05,570 --> 00:21:08,900 is that although I do show some Python code in the lectures, 402 00:21:08,900 --> 00:21:12,740 a lot of the lectures are more conceptually oriented. 403 00:21:12,740 --> 00:21:16,100 Such that you can understand the algorithm in pseudocode. 404 00:21:16,100 --> 00:21:20,300 And I show a lot of pseudocode for these algorithms in the lectures themselves. 405 00:21:20,300 --> 00:21:23,330 And then students could translate that code into Python. 406 00:21:23,330 --> 00:21:26,640 But you could also imagine translating it into another language as well. 407 00:21:26,640 --> 00:21:29,750 And so you could take a lot of the ideas from these lectures 408 00:21:29,750 --> 00:21:33,490 and use it for a different course, too. 409 00:21:33,490 --> 00:21:33,990 A 410 00:21:33,990 --> 00:21:36,710 Question in the chat is will we use basic Python, 411 00:21:36,710 --> 00:21:39,290 or will we use the NumPy library. 412 00:21:39,290 --> 00:21:40,580 A combination of both. 413 00:21:40,580 --> 00:21:45,500 In the earlier in projects, it's almost exclusively just Python on its own 414 00:21:45,500 --> 00:21:48,980 without additional libraries necessary. 415 00:21:48,980 --> 00:21:51,960 But there are cases where NumPy can be helpful, 416 00:21:51,960 --> 00:21:55,610 especially for dealing with arrays of numbers or vectors of numbers, 417 00:21:55,610 --> 00:21:56,840 for example. 418 00:21:56,840 --> 00:22:01,228 And there are cases in later projects where we do have some of that. 419 00:22:01,228 --> 00:22:02,770 Most of the time it's just an option. 420 00:22:02,770 --> 00:22:05,150 That if students want to use NumPy, which 421 00:22:05,150 --> 00:22:09,080 is a mathematics based Python library, for solving some of the projects, 422 00:22:09,080 --> 00:22:10,610 they're certainly welcome to. 423 00:22:10,610 --> 00:22:14,360 But most of the time, they don't have to. 424 00:22:14,360 --> 00:22:17,220 Someone's asking about the links to the slides from yesterday. 425 00:22:17,220 --> 00:22:20,330 So all of the links to all of the sides as well as the videos 426 00:22:20,330 --> 00:22:23,567 are all on the notion page that was just pasted into the chat. 427 00:22:23,567 --> 00:22:25,400 So if you to that URL, you'll be able to see 428 00:22:25,400 --> 00:22:27,620 all of the sessions in the workshop, as well 429 00:22:27,620 --> 00:22:31,840 as links to the draft of the videos, and the slides for all of the sessions 430 00:22:31,840 --> 00:22:32,340 there. 431 00:22:32,340 --> 00:22:34,590 So thank you for posting that in the chat. 432 00:22:34,590 --> 00:22:37,490 There's also a dropbox link that was posted as well that 433 00:22:37,490 --> 00:22:41,710 contains the slides from yesterday. 434 00:22:41,710 --> 00:22:44,788 So in the context of talking about algorithms, 435 00:22:44,788 --> 00:22:46,830 we talk about algorithms like depth-first search, 436 00:22:46,830 --> 00:22:49,800 we analyze these algorithms and in a number of different ways. 437 00:22:49,800 --> 00:22:52,710 We want to think about how efficient these algorithms are. 438 00:22:52,710 --> 00:22:55,920 But we also want to think about when they find us a solution, 439 00:22:55,920 --> 00:23:00,300 like a path to get from point A to point B, how good is that solution? 440 00:23:00,300 --> 00:23:02,020 Is it the optimal solution? 441 00:23:02,020 --> 00:23:05,850 In other words, is it the shortest way to get from one point to another point. 442 00:23:05,850 --> 00:23:08,990 And so we talk about how this particular algorithm, while it will work, 443 00:23:08,990 --> 00:23:13,260 it'll find us a way to get from point A to point B, it might not be optimal. 444 00:23:13,260 --> 00:23:17,530 It might not find the shortest path to get from one point to another. 445 00:23:17,530 --> 00:23:19,080 So we introduce algorithms that do. 446 00:23:19,080 --> 00:23:22,860 Algorithms like breadth-first search, that rather than just try one path 447 00:23:22,860 --> 00:23:26,850 until we hit a dead end, it really tries all of the different paths, 448 00:23:26,850 --> 00:23:30,840 alternating between them, looking for what the shortest path might be. 449 00:23:30,840 --> 00:23:33,210 And it's always going to find shorter solutions 450 00:23:33,210 --> 00:23:35,220 before it finds longer solutions. 451 00:23:35,220 --> 00:23:38,820 And so here then is another algorithm we introduce to. 452 00:23:38,820 --> 00:23:43,050 And then we start to get a little more nuanced about our conversation as well. 453 00:23:43,050 --> 00:23:47,580 Breadth-first search might be able to find the shortest path from A to B. 454 00:23:47,580 --> 00:23:50,880 But how quickly does it find the shortest path from A to B? 455 00:23:50,880 --> 00:23:53,915 How efficient is the algorithm at finding an optimal solution? 456 00:23:53,915 --> 00:23:56,790 And so there are some nuance that we introduce to students that there 457 00:23:56,790 --> 00:23:59,100 might be two things that we care about. 458 00:23:59,100 --> 00:24:02,160 We might care about finding the best solution. 459 00:24:02,160 --> 00:24:04,920 But we also might care about finding a solution quickly. 460 00:24:04,920 --> 00:24:08,250 And those are both valuable things that we might want to balance between. 461 00:24:08,250 --> 00:24:12,000 And depending on the situation, one might be preferable over the other. 462 00:24:12,000 --> 00:24:14,640 If you're looking for driving directions, for example, 463 00:24:14,640 --> 00:24:16,800 between one point and another point, maybe you're 464 00:24:16,800 --> 00:24:19,530 willing to wait a little bit longer for the algorithm 465 00:24:19,530 --> 00:24:24,270 to come up with a faster path for you to get from one place to some other place. 466 00:24:24,270 --> 00:24:26,373 But maybe there are some situations where 467 00:24:26,373 --> 00:24:28,290 the time that you're waiting for the algorithm 468 00:24:28,290 --> 00:24:30,858 to calculate, you may as well just start following a path, 469 00:24:30,858 --> 00:24:32,650 even if it's not going to be the best path. 470 00:24:32,650 --> 00:24:36,130 So there are some trade-offs here as well. 471 00:24:36,130 --> 00:24:38,250 And we talk about other algorithms that might 472 00:24:38,250 --> 00:24:43,170 be even faster than breadth-first search at trying to efficiently figure out 473 00:24:43,170 --> 00:24:44,940 how to get from one point to another. 474 00:24:44,940 --> 00:24:48,060 Building our way to algorithms like A*, if you're familiar with. 475 00:24:48,060 --> 00:24:50,220 I won't get into the mathematical details here. 476 00:24:50,220 --> 00:24:54,480 But A* is an algorithm that can find us the shortest path from A to B. 477 00:24:54,480 --> 00:24:59,190 But it can do so without having to explore as much as some of these other 478 00:24:59,190 --> 00:25:00,427 algorithms need to. 479 00:25:00,427 --> 00:25:02,760 So we talk about the trade off between those algorithms, 480 00:25:02,760 --> 00:25:05,343 what makes some of them better, what makes some of them worse. 481 00:25:05,343 --> 00:25:09,690 All in the goal of trying to solve these kinds of problems. 482 00:25:09,690 --> 00:25:12,300 We then turn our attention in this part of the class 483 00:25:12,300 --> 00:25:16,680 to a different type of search problem, known as adversarial search. 484 00:25:16,680 --> 00:25:19,590 Where in adversarial search problems, it's not just 485 00:25:19,590 --> 00:25:21,960 that you're trying to find your way to some goal, 486 00:25:21,960 --> 00:25:25,020 but that you are trying to find your way to some goal and someone else 487 00:25:25,020 --> 00:25:27,020 is trying to stop you. 488 00:25:27,020 --> 00:25:30,300 And this comes up the most often in the case of a game, for example. 489 00:25:30,300 --> 00:25:34,410 You might be familiar with artificial intelligence that 490 00:25:34,410 --> 00:25:38,070 now is able to beat the world's best chess players or the world's best 491 00:25:38,070 --> 00:25:40,170 go players, even more recently. 492 00:25:40,170 --> 00:25:43,950 And the way that they do this is via some form of adversarial search, 493 00:25:43,950 --> 00:25:48,180 where they're thinking about what can I do that's the best possible choice. 494 00:25:48,180 --> 00:25:52,080 And based on what I do, what might the opponent do to try to stop me, 495 00:25:52,080 --> 00:25:54,540 and how can I design an artificial intelligence that 496 00:25:54,540 --> 00:25:57,090 can play games efficiently? 497 00:25:57,090 --> 00:25:59,700 And so we talk about algorithms for trying 498 00:25:59,700 --> 00:26:01,330 to solve these kinds of problems. 499 00:26:01,330 --> 00:26:04,570 One of the most famous is Minimax, which is an algorithm. 500 00:26:04,570 --> 00:26:08,100 A recursive algorithm that really considers 501 00:26:08,100 --> 00:26:11,490 what are all of the possible moves that I could make, and tries to calculate 502 00:26:11,490 --> 00:26:14,070 which of those moves is the best move based 503 00:26:14,070 --> 00:26:18,270 on how the opponent is going to respond to each of those possible moves. 504 00:26:18,270 --> 00:26:20,250 And it considers all the way until the end 505 00:26:20,250 --> 00:26:23,430 of the game what's the best move going to be in this position. 506 00:26:23,430 --> 00:26:26,330 And using Minimax, you can design artificial intelligence 507 00:26:26,330 --> 00:26:28,290 that can play games optimally. 508 00:26:28,290 --> 00:26:32,690 That will always make the best move, no matter what the situation. 509 00:26:32,690 --> 00:26:35,190 Now of course there are limits on these kinds of algorithms, 510 00:26:35,190 --> 00:26:39,570 especially in games that can have a lot of moves and a lot of possible options. 511 00:26:39,570 --> 00:26:42,240 It can get far too crazy complicated for a computer 512 00:26:42,240 --> 00:26:44,580 to be able to consider all those possibilities 513 00:26:44,580 --> 00:26:46,110 in a reasonable amount of time. 514 00:26:46,110 --> 00:26:48,030 So we talk about strategies the computers can 515 00:26:48,030 --> 00:26:51,420 use to try to make these sorts of algorithms more efficient. 516 00:26:51,420 --> 00:26:55,120 Heuristics that they can use, or particular more mathematical strategy 517 00:26:55,120 --> 00:26:58,200 is like alpha beta pruning, if familiar with that idea, 518 00:26:58,200 --> 00:27:03,180 which is a strategy for trying to make these algorithms more efficient 519 00:27:03,180 --> 00:27:06,275 by ignoring pieces of data that really don't matter, 520 00:27:06,275 --> 00:27:07,650 that we don't need to care about. 521 00:27:07,650 --> 00:27:10,920 So we talk about the algorithms for how to do that and give students 522 00:27:10,920 --> 00:27:13,920 the option of trying to implement it. 523 00:27:13,920 --> 00:27:18,750 And ultimately, for the projects for each of these topics in the course, 524 00:27:18,750 --> 00:27:21,900 we ask students to take these ideas and take these algorithms 525 00:27:21,900 --> 00:27:26,760 and write some Python code to be able to put these algorithms into action. 526 00:27:26,760 --> 00:27:29,070 And so associated with this first topic search, 527 00:27:29,070 --> 00:27:31,830 there are two projects that we ask students to work on. 528 00:27:31,830 --> 00:27:33,700 The first is called degrees. 529 00:27:33,700 --> 00:27:37,680 And this has to do with degrees of separation in a movie, for example. 530 00:27:37,680 --> 00:27:41,460 Where the idea is if I give you two actors or actresses, 531 00:27:41,460 --> 00:27:45,390 can you figure out how I can get from one actor or actress 532 00:27:45,390 --> 00:27:48,720 to another based on some sequence of movies 533 00:27:48,720 --> 00:27:50,550 that different people have all starred in. 534 00:27:50,550 --> 00:27:53,460 If you've heard of the seven degrees from Kevin Bacon 535 00:27:53,460 --> 00:27:55,980 type of exercise that you see on the internet sometimes. 536 00:27:55,980 --> 00:27:58,320 It's very much inspired by that idea of how 537 00:27:58,320 --> 00:28:01,860 do you connect people together based on works 538 00:28:01,860 --> 00:28:03,720 that they have collaborated together with. 539 00:28:03,720 --> 00:28:08,110 And so this is an example of where a search problem might prove helpful. 540 00:28:08,110 --> 00:28:10,857 We then ask students to implement an artificial intelligence 541 00:28:10,857 --> 00:28:14,190 to play a game, the first of a couple of games that we'll look at in the course. 542 00:28:14,190 --> 00:28:15,390 In this case, tic-tac-toe. 543 00:28:15,390 --> 00:28:19,530 So students write a program to play tic-tac-toe, an artificial intelligence 544 00:28:19,530 --> 00:28:21,390 that always makes the best move. 545 00:28:21,390 --> 00:28:25,110 And if they do so successfully, they should never be able to beat their AI. 546 00:28:25,110 --> 00:28:28,680 No matter what, they should always either tie with the AI. 547 00:28:28,680 --> 00:28:32,550 Or if they're not playing optimally, they might lose to their own AI. 548 00:28:32,550 --> 00:28:35,680 But we ask students to implement that algorithm as well. 549 00:28:35,680 --> 00:28:40,870 So that then is the first part of the class, all about search. 550 00:28:40,870 --> 00:28:43,050 A pause now for any questions about it. 551 00:28:43,050 --> 00:28:45,940 552 00:28:45,940 --> 00:28:49,628 Backpropagation and gradient descent do get covered a little bit later 553 00:28:49,628 --> 00:28:50,170 in the class. 554 00:28:50,170 --> 00:28:54,610 We don't go into all of the mathematical details about those techniques. 555 00:28:54,610 --> 00:28:56,740 In particular because those techniques involve them 556 00:28:56,740 --> 00:28:59,350 a little bit of a higher level of mathematics than we 557 00:28:59,350 --> 00:29:01,227 assume as part of this class. 558 00:29:01,227 --> 00:29:04,060 But they're relevant enough that we want to at least talk about them 559 00:29:04,060 --> 00:29:05,770 and introduce them conceptually. 560 00:29:05,770 --> 00:29:09,070 So we show students, in principle, what these algorithms are supposed 561 00:29:09,070 --> 00:29:11,800 to do, and then give students libraries and tools 562 00:29:11,800 --> 00:29:13,390 to be able to put them into practice. 563 00:29:13,390 --> 00:29:18,430 But we're not going to teach students the exact algorithm 564 00:29:18,430 --> 00:29:20,410 for how they would calculate the gradient 565 00:29:20,410 --> 00:29:22,660 or how they would do the math backpropagation. 566 00:29:22,660 --> 00:29:24,610 Certainly those things are important. 567 00:29:24,610 --> 00:29:27,640 And if you wanted to implement your own neural network from scratch, 568 00:29:27,640 --> 00:29:29,912 for example, those are things you would need to do. 569 00:29:29,912 --> 00:29:31,870 But for the purpose of this introductory course 570 00:29:31,870 --> 00:29:34,420 that was designed to be lighter, in terms 571 00:29:34,420 --> 00:29:38,140 of the mathematical prerequisites, we don't go into all of those details 572 00:29:38,140 --> 00:29:39,040 there. 573 00:29:39,040 --> 00:29:41,020 Other questions about anything here? 574 00:29:41,020 --> 00:29:41,770 Yeah, Ramon? 575 00:29:41,770 --> 00:29:43,200 I see you have your hand raised. 576 00:29:43,200 --> 00:29:47,740 RAMON: My question is concerning the misconceptions that people usually 577 00:29:47,740 --> 00:29:50,840 have when it comes to AI. 578 00:29:50,840 --> 00:29:55,420 Like watching movies, we tend to think that AI is something. 579 00:29:55,420 --> 00:30:01,150 But when we actually go to learn it, it's something completely different. 580 00:30:01,150 --> 00:30:09,700 And even inside the programming coacher, I'm sure lots of people 581 00:30:09,700 --> 00:30:14,950 here have some experience with command line programming and also 582 00:30:14,950 --> 00:30:15,640 web programming. 583 00:30:15,640 --> 00:30:18,490 But I'm sure that many people, including me, 584 00:30:18,490 --> 00:30:21,670 don't really understand how AI works. 585 00:30:21,670 --> 00:30:26,550 So I would like you to kind of talk about the misconceptions. 586 00:30:26,550 --> 00:30:30,110 BRIAN YEW: Yes, so artificial intelligence can mean a lot of things, 587 00:30:30,110 --> 00:30:33,410 and people have attributed a lot of different definitions of what 588 00:30:33,410 --> 00:30:35,480 artificial intelligence is all about. 589 00:30:35,480 --> 00:30:38,390 I think the best definition I've seen has 590 00:30:38,390 --> 00:30:42,380 to do with both thinking and acting. 591 00:30:42,380 --> 00:30:45,320 And then both whether you're being rational or being humans. 592 00:30:45,320 --> 00:30:49,970 You might define artificial intelligence as thinking rationally or thinking 593 00:30:49,970 --> 00:30:50,810 humanly. 594 00:30:50,810 --> 00:30:55,250 You might define artificial intelligence as acting rationally or acting humanly. 595 00:30:55,250 --> 00:31:00,380 In each of those four different areas contain some different nuances 596 00:31:00,380 --> 00:31:01,790 and different ideas within it. 597 00:31:01,790 --> 00:31:05,695 That's explained very well in Artificial Intelligence, A Modern Approach, 598 00:31:05,695 --> 00:31:08,570 which is one of the most popular textbooks in artificial intelligence 599 00:31:08,570 --> 00:31:09,440 out there. 600 00:31:09,440 --> 00:31:11,690 Not a required textbook for the class. 601 00:31:11,690 --> 00:31:13,668 But students who ask me what textbook should I 602 00:31:13,668 --> 00:31:16,460 be looking at for artificial intelligence, that's the one I usually 603 00:31:16,460 --> 00:31:19,460 recommend for just introducing artificial intelligence. 604 00:31:19,460 --> 00:31:22,490 And there's a lot of overlap between the ideas in that book 605 00:31:22,490 --> 00:31:25,010 and the ideas in this course, though they're 606 00:31:25,010 --> 00:31:27,380 not a they're not a complete match. 607 00:31:27,380 --> 00:31:29,990 But certainly if you watch the movies, you often 608 00:31:29,990 --> 00:31:33,350 get a sense of artificial intelligence that you'll often 609 00:31:33,350 --> 00:31:37,160 hear called artificial general intelligence or AGI. 610 00:31:37,160 --> 00:31:41,360 Where the idea is that these AIs are effectively like superhumans 611 00:31:41,360 --> 00:31:44,330 that are able to just do all human things plus more 612 00:31:44,330 --> 00:31:47,720 and are way more intelligent in every capacity. 613 00:31:47,720 --> 00:31:52,790 In this class, we try to get a better, more formal understanding 614 00:31:52,790 --> 00:31:58,040 for the algorithms that underlie some of the more sophisticated types of AI 615 00:31:58,040 --> 00:32:01,250 that you might see in other places that are often combining multiple 616 00:32:01,250 --> 00:32:02,540 of these ideas together. 617 00:32:02,540 --> 00:32:05,150 And just to lay the foundation for those principles 618 00:32:05,150 --> 00:32:08,320 on top of which you might add other things as well. 619 00:32:08,320 --> 00:32:11,510 And later in the course, we start to get into things like natural language 620 00:32:11,510 --> 00:32:14,440 processing, and try and look at the task of, 621 00:32:14,440 --> 00:32:16,430 if an AI actually wanted to talk to people 622 00:32:16,430 --> 00:32:18,830 and communicate with people in human language, what 623 00:32:18,830 --> 00:32:22,432 would the challenges there be, and how might that work. 624 00:32:22,432 --> 00:32:24,640 The title of the book, someone asked me to repeat it. 625 00:32:24,640 --> 00:32:29,147 It's Artificial Intelligence, A Modern Approach, by Russell and Norvig. 626 00:32:29,147 --> 00:32:30,855 It's a great textbook for an introduction 627 00:32:30,855 --> 00:32:32,200 to artificial intelligence. 628 00:32:32,200 --> 00:32:34,950 There was just a new version in the book released fairly recently, 629 00:32:34,950 --> 00:32:37,320 in the last couple of months, too. 630 00:32:37,320 --> 00:32:39,075 Joe, I see you have your hand raised. 631 00:32:39,075 --> 00:32:40,430 JOE: Yeah. 632 00:32:40,430 --> 00:32:44,150 So there were things that were just called statistics, like K 633 00:32:44,150 --> 00:32:46,710 means clustering and random forest. 634 00:32:46,710 --> 00:32:51,630 But all of a sudden, those algorithms or models are called AI. 635 00:32:51,630 --> 00:32:54,740 So that's the part that's confusing. 636 00:32:54,740 --> 00:32:57,920 To me, I don't know if AI is necessarily deep learning, 637 00:32:57,920 --> 00:33:00,770 but deep learning is a good example of AI. 638 00:33:00,770 --> 00:33:04,490 So will you be clarifying that part, like OK, this 639 00:33:04,490 --> 00:33:06,520 can be done without any AI. 640 00:33:06,520 --> 00:33:11,150 You know, some of those models you could do by hand, if you wanted. 641 00:33:11,150 --> 00:33:14,840 But that's the part that really I would like some distinction 642 00:33:14,840 --> 00:33:19,065 as you go through the material. 643 00:33:19,065 --> 00:33:20,190 BRIAN YEW: Yeah, certainly. 644 00:33:20,190 --> 00:33:26,280 So I think a lot of what is considered AI very much overlaps with what 645 00:33:26,280 --> 00:33:30,325 is statistics or what is, in some cases, linear algebra, 646 00:33:30,325 --> 00:33:32,700 especially when we get into the world of neural networks. 647 00:33:32,700 --> 00:33:36,840 Because really, it comes down to just mathematical algorithms 648 00:33:36,840 --> 00:33:41,170 that are known for being able to solve a particular type of problem. 649 00:33:41,170 --> 00:33:43,810 And so I think there is a lot of overlap there. 650 00:33:43,810 --> 00:33:44,310 A 651 00:33:44,310 --> 00:33:49,680 Lot of what we might just think of as statistics, when taken to an applied 652 00:33:49,680 --> 00:33:55,080 to a problem that maybe humans previously weren't as good at solving 653 00:33:55,080 --> 00:34:00,000 or that seem like the type of thing that requires human thought and calculation, 654 00:34:00,000 --> 00:34:02,640 then we could start to call that artificial intelligence. 655 00:34:02,640 --> 00:34:06,270 But people are going to disagree on what the exact definition 656 00:34:06,270 --> 00:34:07,620 of artificial intelligence is. 657 00:34:07,620 --> 00:34:10,469 It's a sort of philosophical question that can take you 658 00:34:10,469 --> 00:34:11,920 in a number of different places. 659 00:34:11,920 --> 00:34:14,370 But what you'll see throughout this course in particular 660 00:34:14,370 --> 00:34:17,250 is that a lot of what we think of as artificial intelligence 661 00:34:17,250 --> 00:34:21,340 is really just algorithms that are based on some mathematical fundamentals, 662 00:34:21,340 --> 00:34:24,810 things like logic and statistics and probability, that are then 663 00:34:24,810 --> 00:34:29,949 applied to solve a more human like problems, like solving a game, 664 00:34:29,949 --> 00:34:31,800 for example. 665 00:34:31,800 --> 00:34:35,909 Looking for other questions. 666 00:34:35,909 --> 00:34:38,159 Oh, so applications of artificial intelligence. 667 00:34:38,159 --> 00:34:39,960 Are there more commercial applications? 668 00:34:39,960 --> 00:34:40,860 Yes, certainly. 669 00:34:40,860 --> 00:34:45,330 And we'll get to some of those in some of the later projects, too. 670 00:34:45,330 --> 00:34:47,310 Games are usually a good place to start, just 671 00:34:47,310 --> 00:34:50,797 because they're a relatively well-defined and simple world 672 00:34:50,797 --> 00:34:51,880 in which you're operating. 673 00:34:51,880 --> 00:34:54,969 And therefore, the algorithms are a little bit easier at first. 674 00:34:54,969 --> 00:34:58,440 But soon, especially when we get to the machine learning side of things, 675 00:34:58,440 --> 00:35:02,150 things start to get a little bit more sophisticated. 676 00:35:02,150 --> 00:35:05,650 So I'll go through some now of the other topics that we talk about in the class. 677 00:35:05,650 --> 00:35:07,810 The next big topic is about knowledge. 678 00:35:07,810 --> 00:35:09,970 And so this part of the class is entirely about 679 00:35:09,970 --> 00:35:12,970 how is it that artificial intelligence can 680 00:35:12,970 --> 00:35:15,890 represent information and knowledge. 681 00:35:15,890 --> 00:35:19,570 And how can AI use that knowledge to be able to draw new conclusions 682 00:35:19,570 --> 00:35:23,570 and gather more knowledge in the future as well. 683 00:35:23,570 --> 00:35:28,780 So one of the simplest ways to represent knowledge is using propositional logic. 684 00:35:28,780 --> 00:35:32,470 We don't assume that students have seen propositional logic before, 685 00:35:32,470 --> 00:35:33,130 necessarily. 686 00:35:33,130 --> 00:35:35,440 Though they've probably come across concepts 687 00:35:35,440 --> 00:35:38,680 like not, and and, and or, at least in the context of programming. 688 00:35:38,680 --> 00:35:43,228 But we introduce some more logical language for how these operators work. 689 00:35:43,228 --> 00:35:46,270 And if you're familiar with logic, we introduce students to truth tables. 690 00:35:46,270 --> 00:35:50,890 It can be used in order to determine how to evaluate 691 00:35:50,890 --> 00:35:52,570 some sort of logical expression. 692 00:35:52,570 --> 00:35:55,300 Determine if something is true or false. 693 00:35:55,300 --> 00:35:58,230 And this, we relate to AI in the context of, 694 00:35:58,230 --> 00:36:02,650 we want AI to be able to answer questions about is something true? 695 00:36:02,650 --> 00:36:05,560 We want AI to be able to have some pieces of knowledge 696 00:36:05,560 --> 00:36:09,130 and to be able to infer new pieces of information 697 00:36:09,130 --> 00:36:10,520 from that existing knowledge. 698 00:36:10,520 --> 00:36:13,840 And so we talk about rules for logical inference, 699 00:36:13,840 --> 00:36:16,690 for being able to take existing pieces of information, 700 00:36:16,690 --> 00:36:20,890 and then draw new conclusions from those existing pieces of information. 701 00:36:20,890 --> 00:36:23,800 And so here is a simple example of a logical rule. 702 00:36:23,800 --> 00:36:28,150 All this logical rule is saying is that on the first line we have A implies B, 703 00:36:28,150 --> 00:36:29,117 or alpha implies beta. 704 00:36:29,117 --> 00:36:32,200 Meaning that if the thing on the left is true, then the thing on the right 705 00:36:32,200 --> 00:36:32,795 is true. 706 00:36:32,795 --> 00:36:35,170 Therefore, if we know that the thing on the left is true, 707 00:36:35,170 --> 00:36:39,490 alpha, then we can conclude that the thing on the right is true, beta. 708 00:36:39,490 --> 00:36:42,670 And that's a relatively simple logical inference rule. 709 00:36:42,670 --> 00:36:45,070 And there are many simple logical inference rules. 710 00:36:45,070 --> 00:36:47,560 But by combining them together and using algorithms 711 00:36:47,560 --> 00:36:50,530 to be able to use existing knowledge to draw new inferences, 712 00:36:50,530 --> 00:36:54,550 you can begin to draw more complex conclusions. 713 00:36:54,550 --> 00:36:57,460 Now propositional logic isn't the only way to represent information. 714 00:36:57,460 --> 00:36:58,668 There are other ways as well. 715 00:36:58,668 --> 00:37:01,840 We introduce students to a little bit of first order logic, which 716 00:37:01,840 --> 00:37:04,480 is a slightly more sophisticated form of logic that 717 00:37:04,480 --> 00:37:08,372 allows us to represent different pieces of information, as well. 718 00:37:08,372 --> 00:37:10,330 But then we turn our attention to the projects. 719 00:37:10,330 --> 00:37:14,620 And these projects, for now, are applications of the representation 720 00:37:14,620 --> 00:37:16,280 of knowledge and information. 721 00:37:16,280 --> 00:37:21,340 And so the first project we ask students to ride a solution form 722 00:37:21,340 --> 00:37:22,980 is called Knights. 723 00:37:22,980 --> 00:37:27,340 And this is really a writing AI to solve these sorts of logic puzzles. 724 00:37:27,340 --> 00:37:29,200 You may be familiar with these logic puzzles 725 00:37:29,200 --> 00:37:32,470 where you have some people that always tell the truth and some people that 726 00:37:32,470 --> 00:37:33,820 are always lying. 727 00:37:33,820 --> 00:37:37,270 And based on what they say, you have to draw some conclusions from it. 728 00:37:37,270 --> 00:37:39,340 We asked students to, even if they couldn't 729 00:37:39,340 --> 00:37:41,740 be able to solve these kinds of puzzles on their own, 730 00:37:41,740 --> 00:37:46,150 to be able to write an AI that is able to solve these puzzles by logically 731 00:37:46,150 --> 00:37:48,010 deducing what the answers must be. 732 00:37:48,010 --> 00:37:50,140 And this is really more of a warm up problem 733 00:37:50,140 --> 00:37:54,220 for the main problem of this project, which is another game, 734 00:37:54,220 --> 00:37:55,910 and that game is Minesweeper. 735 00:37:55,910 --> 00:37:58,210 So Minesweeper, if unfamiliar, is a game where 736 00:37:58,210 --> 00:38:01,540 you're trying to identify where mines are located on a grid. 737 00:38:01,540 --> 00:38:06,130 And you do so by clicking on cells that tell you how many mines surround 738 00:38:06,130 --> 00:38:07,660 that particular square. 739 00:38:07,660 --> 00:38:10,510 And so using that information that you're given, 740 00:38:10,510 --> 00:38:14,590 you have to draw logical conclusions about where the mines might be 741 00:38:14,590 --> 00:38:16,740 and what should happen next. 742 00:38:16,740 --> 00:38:19,660 And so this is an example of using and representing 743 00:38:19,660 --> 00:38:25,080 knowledge to be able to draw new conclusions in the future. 744 00:38:25,080 --> 00:38:28,605 Good books or resources on propositional and predicate logic. 745 00:38:28,605 --> 00:38:31,058 746 00:38:31,058 --> 00:38:31,850 There are a couple. 747 00:38:31,850 --> 00:38:33,950 I'm forgetting the titles offhand. 748 00:38:33,950 --> 00:38:36,920 I know that the AI book that I suggested does 749 00:38:36,920 --> 00:38:39,980 talk a fair bit about propositional logic 750 00:38:39,980 --> 00:38:42,112 and maybe predicate logic as well. 751 00:38:42,112 --> 00:38:45,320 But this is an area where you might be able to find books that aren't even AI 752 00:38:45,320 --> 00:38:50,690 specific, that are just more generally about propositional or predicate logic 753 00:38:50,690 --> 00:38:51,680 too. 754 00:38:51,680 --> 00:38:55,220 So that then is the part of the class where we're talking about knowledge. 755 00:38:55,220 --> 00:38:59,690 Representing information, things that our artificial intelligence can know. 756 00:38:59,690 --> 00:39:03,215 But oftentimes when dealing with information in the world, 757 00:39:03,215 --> 00:39:05,840 we're not dealing with information that artificial intelligence 758 00:39:05,840 --> 00:39:07,160 knows for certain. 759 00:39:07,160 --> 00:39:08,960 We're dealing with uncertainty. 760 00:39:08,960 --> 00:39:11,840 Things that artificial intelligence might be uncertain about, 761 00:39:11,840 --> 00:39:15,770 and how does AI deal with uncertainty and uncertain events 762 00:39:15,770 --> 00:39:19,090 to be able to draw new conclusions. 763 00:39:19,090 --> 00:39:21,880 Prolog is question that was asked about-- 764 00:39:21,880 --> 00:39:24,410 Prolog I don't have a lot of experience with Prolog. 765 00:39:24,410 --> 00:39:26,810 I know that it's a logic programming language that's 766 00:39:26,810 --> 00:39:31,130 very useful, in particular, for the kinds of propositional and predicate 767 00:39:31,130 --> 00:39:34,680 logic topics that we were just talking about in the last section. 768 00:39:34,680 --> 00:39:38,090 So for being able to draw inferences based on pieces of knowledge, 769 00:39:38,090 --> 00:39:41,000 Prolog and Datalog, which is closely related, 770 00:39:41,000 --> 00:39:43,920 are quite good for that kind of thing. 771 00:39:43,920 --> 00:39:46,820 But they're probably less applicable for when we get further 772 00:39:46,820 --> 00:39:52,280 into some of the other topics in AI, where we really 773 00:39:52,280 --> 00:39:56,600 want a fuller procedural programming language, something like Python, 774 00:39:56,600 --> 00:39:58,400 where Prolog might be a little bit limited. 775 00:39:58,400 --> 00:40:01,640 But for certain types of problems and certain types of questions, 776 00:40:01,640 --> 00:40:05,270 logic programming languages like Prolog can actually be quite helpful. 777 00:40:05,270 --> 00:40:08,960 And I think they're a good way of showing propositional logic 778 00:40:08,960 --> 00:40:10,672 and predicate logic, too. 779 00:40:10,672 --> 00:40:12,380 All right so on the topic of uncertainty. 780 00:40:12,380 --> 00:40:15,660 This is the next big theme and topic within the course. 781 00:40:15,660 --> 00:40:19,280 We first start by introducing students to probability, 782 00:40:19,280 --> 00:40:20,870 and the fundamentals of probability. 783 00:40:20,870 --> 00:40:23,570 We don't assume a whole lot of prior familiarity 784 00:40:23,570 --> 00:40:24,928 with probability or statistics. 785 00:40:24,928 --> 00:40:26,720 So we're introducing it from the beginning. 786 00:40:26,720 --> 00:40:29,030 Talking about what a probability means. 787 00:40:29,030 --> 00:40:31,850 Just some value from 0 to 1, in this case 788 00:40:31,850 --> 00:40:35,780 representing how likely it is that when I roll a die, I get the number 789 00:40:35,780 --> 00:40:37,110 2, for example. 790 00:40:37,110 --> 00:40:41,280 So we could draw these examples of what probability's all about. 791 00:40:41,280 --> 00:40:43,290 And usually in the context of what we want 792 00:40:43,290 --> 00:40:47,460 our AI to do, and in the context of probability more generally, 793 00:40:47,460 --> 00:40:51,660 we don't just care about what is the probability of some event happening 794 00:40:51,660 --> 00:40:52,680 in the void. 795 00:40:52,680 --> 00:40:55,230 We care about something called conditional probability. 796 00:40:55,230 --> 00:40:58,770 We care about, what is the probability of this thing happening, based 797 00:40:58,770 --> 00:41:01,200 on information that we already know. 798 00:41:01,200 --> 00:41:04,020 So we might care about the probability that it rains today. 799 00:41:04,020 --> 00:41:07,230 But we can get a better answer by asking the question, what 800 00:41:07,230 --> 00:41:10,560 is the probability that it rains today, given that we already 801 00:41:10,560 --> 00:41:12,750 know that it rained yesterday. 802 00:41:12,750 --> 00:41:15,480 So given that existing information, how can 803 00:41:15,480 --> 00:41:19,470 we use that existing information to draw new conclusions 804 00:41:19,470 --> 00:41:23,290 or to make updated estimates about what we think about the world. 805 00:41:23,290 --> 00:41:26,580 And this is a large part of how a lot of different algorithms 806 00:41:26,580 --> 00:41:29,580 in artificial intelligence work. 807 00:41:29,580 --> 00:41:33,000 That artificial intelligence is going to have 808 00:41:33,000 --> 00:41:35,130 some sort of existing knowledge base. 809 00:41:35,130 --> 00:41:37,350 And then based on that existing knowledge base, 810 00:41:37,350 --> 00:41:41,610 use that knowledge to be able to make estimates about the world. 811 00:41:41,610 --> 00:41:44,260 Question in the chat, is there an age limit to teach AI? 812 00:41:44,260 --> 00:41:48,082 Is CS50 for ages 12 and up, mainly because some of the topics 813 00:41:48,082 --> 00:41:50,790 can start to be more challenging as you dig into some of the more 814 00:41:50,790 --> 00:41:53,370 mathematical and statistical topics. 815 00:41:53,370 --> 00:41:56,490 Certainly having a little bit of mathematical comfort 816 00:41:56,490 --> 00:41:58,710 and being a little bit older can help. 817 00:41:58,710 --> 00:42:01,320 In the classes that we've offered through Harvard, 818 00:42:01,320 --> 00:42:05,850 I've had students as young as their first or second year of high school 819 00:42:05,850 --> 00:42:08,190 take the class and be successful in it. 820 00:42:08,190 --> 00:42:12,182 So that age has been appropriate for students in the past. 821 00:42:12,182 --> 00:42:13,890 As for whether students younger than that 822 00:42:13,890 --> 00:42:16,350 might still be able to access the materials, if they 823 00:42:16,350 --> 00:42:20,965 have prior comfort with Python and feel a little more comfortable with doing 824 00:42:20,965 --> 00:42:24,090 a little bit of math, even though we're introducing the mathematical topics 825 00:42:24,090 --> 00:42:25,320 here, certainly OK. 826 00:42:25,320 --> 00:42:27,630 But we'd leave that up to the judgment of you 827 00:42:27,630 --> 00:42:30,910 as the teacher to determine that to. 828 00:42:30,910 --> 00:42:33,080 Yeah, certainly with high school students, 829 00:42:33,080 --> 00:42:35,705 we've had several high school students who have taken the class 830 00:42:35,705 --> 00:42:38,960 and have come in with a little bit of prior programming experience in Python, 831 00:42:38,960 --> 00:42:41,830 but oftentimes in Java as well, and still 832 00:42:41,830 --> 00:42:46,760 been able to grasp and work with the material as well. 833 00:42:46,760 --> 00:42:52,780 Is there a platform to save and deploy the models like a git repository? 834 00:42:52,780 --> 00:42:56,080 Certainly, if you train any model as part of the AI course 835 00:42:56,080 --> 00:42:58,690 and you want to publish them on a git repository, 836 00:42:58,690 --> 00:43:01,990 you're absolutely welcome to do so. 837 00:43:01,990 --> 00:43:03,145 That's definitely OK. 838 00:43:03,145 --> 00:43:05,020 Not strictly part of the class, not something 839 00:43:05,020 --> 00:43:07,210 we expect or require of students. 840 00:43:07,210 --> 00:43:13,160 But we'll talk about machine learning in a later part of this session. 841 00:43:13,160 --> 00:43:17,350 All right, so we introduce students to some of the that 842 00:43:17,350 --> 00:43:20,180 exist inside of probability and statistics. 843 00:43:20,180 --> 00:43:23,860 So Bayes' rule is one of the most important rules in statistics, 844 00:43:23,860 --> 00:43:27,440 especially as far as artificial intelligence is concerned. 845 00:43:27,440 --> 00:43:30,512 And it's really a rule for helping us to be able to calculate 846 00:43:30,512 --> 00:43:31,720 these sorts of probabilities. 847 00:43:31,720 --> 00:43:36,430 Calculating what is the probability of this thing happening given all 848 00:43:36,430 --> 00:43:39,670 of the information that I already know. 849 00:43:39,670 --> 00:43:42,670 So after this, we turn our attention to some 850 00:43:42,670 --> 00:43:46,600 of the data structures that are commonly used in artificial intelligence that 851 00:43:46,600 --> 00:43:50,060 take advantage of this kind of knowledge and this kind of reasoning. 852 00:43:50,060 --> 00:43:52,810 So these are structures like Bayesian networks, which 853 00:43:52,810 --> 00:43:55,390 are some way of trying to relate together events 854 00:43:55,390 --> 00:43:58,640 and trying to estimate how it is that they influence each other. 855 00:43:58,640 --> 00:44:01,730 So here on the right, for example, even if you've never seen this before, 856 00:44:01,730 --> 00:44:04,360 this is a Bayesian network that's trying to determine, 857 00:44:04,360 --> 00:44:06,610 am I going to miss my appointment that's out of town? 858 00:44:06,610 --> 00:44:10,270 And the idea is that if it's raining, well then my train might be delayed, 859 00:44:10,270 --> 00:44:13,210 and if my train is delayed, that might increase the probability 860 00:44:13,210 --> 00:44:14,800 that I miss my appointment. 861 00:44:14,800 --> 00:44:18,490 It's a relatively simple example, just to get across the idea 862 00:44:18,490 --> 00:44:21,130 that we have all of these interrelated variables. 863 00:44:21,130 --> 00:44:24,950 And using those interrelated variables, we can draw conclusions. 864 00:44:24,950 --> 00:44:28,042 And so this is a constructed example used in the lecture. 865 00:44:28,042 --> 00:44:30,250 But in one of the projects, which I'll show you soon, 866 00:44:30,250 --> 00:44:33,910 we use a model that's similar to this to solve some very real world 867 00:44:33,910 --> 00:44:36,240 problems as well. 868 00:44:36,240 --> 00:44:39,060 After that, we show students Markov Chains, 869 00:44:39,060 --> 00:44:42,450 which are sequences of values that are determined 870 00:44:42,450 --> 00:44:44,500 based on some kind of probability. 871 00:44:44,500 --> 00:44:46,320 So you might try to do something like model 872 00:44:46,320 --> 00:44:48,210 the weather based on a Markov Chain. 873 00:44:48,210 --> 00:44:51,240 Where the idea here is that if it's sunny today, 874 00:44:51,240 --> 00:44:53,782 that increases the probability that it's sunny tomorrow. 875 00:44:53,782 --> 00:44:55,740 That often there are these patterns of weather. 876 00:44:55,740 --> 00:44:58,470 And if it's raining today, well, that increases the likelihood 877 00:44:58,470 --> 00:45:00,220 that I think it might be raining tomorrow. 878 00:45:00,220 --> 00:45:03,047 That if I already knew that it was raining today, then 879 00:45:03,047 --> 00:45:05,880 I think it's more likely that it's going to rain tomorrow than if it 880 00:45:05,880 --> 00:45:07,810 were sunny today, for example. 881 00:45:07,810 --> 00:45:10,110 And so we talk about trying to encode some 882 00:45:10,110 --> 00:45:14,290 of that logic in some of those ideas and how these models can be useful. 883 00:45:14,290 --> 00:45:17,790 And one of the projects touches on this as well. 884 00:45:17,790 --> 00:45:20,610 Question is, what about greedy and dynamic algorithms? 885 00:45:20,610 --> 00:45:25,320 Is it something that we consider as a basis for students or is it introduced? 886 00:45:25,320 --> 00:45:28,410 If you're talking about dynamic programming specifically, 887 00:45:28,410 --> 00:45:32,490 I don't believe any of the algorithms in this class use dynamic programming. 888 00:45:32,490 --> 00:45:34,980 As for greedy approaches to algorithms, when 889 00:45:34,980 --> 00:45:38,433 I get to the optimization part of the class, which is coming next, 890 00:45:38,433 --> 00:45:40,350 there are some examples of algorithms that you 891 00:45:40,350 --> 00:45:42,750 might consider to be greedy in nature. 892 00:45:42,750 --> 00:45:46,320 But we don't assume prior familiarity with those particular terms 893 00:45:46,320 --> 00:45:48,360 or this particular ideas before. 894 00:45:48,360 --> 00:45:51,030 The final data structure we introduce students to in AI 895 00:45:51,030 --> 00:45:54,108 is Hidden Markov Models, which are in incredibly powerful data structure 896 00:45:54,108 --> 00:45:55,650 for a whole bunch of types of things. 897 00:45:55,650 --> 00:45:58,170 For being able to do audio processing and 898 00:45:58,170 --> 00:46:02,040 for being able to do image processing and reasoning about uncertainty 899 00:46:02,040 --> 00:46:02,970 and more. 900 00:46:02,970 --> 00:46:06,590 My own undergraduate research involved Hidden Markov Models quite a bit. 901 00:46:06,590 --> 00:46:08,970 And Hidden Markov Models are really about trying 902 00:46:08,970 --> 00:46:14,190 to understand some unknown information based on your observations. 903 00:46:14,190 --> 00:46:16,800 That a robot, for example, might have sensors 904 00:46:16,800 --> 00:46:19,980 that are observing things that are around it or distances 905 00:46:19,980 --> 00:46:21,090 to nearby objects. 906 00:46:21,090 --> 00:46:23,460 And based on that sensor data, I want to figure out 907 00:46:23,460 --> 00:46:25,320 where the robot is in the world. 908 00:46:25,320 --> 00:46:28,590 Or I might have audio data just recorded from a microphone, 909 00:46:28,590 --> 00:46:30,420 a whole bunch of noisy wave forms. 910 00:46:30,420 --> 00:46:32,610 And based on those wave forms, I want to find out, 911 00:46:32,610 --> 00:46:34,820 what are the words that the person actually spoke, 912 00:46:34,820 --> 00:46:37,410 and determine what those words actually are. 913 00:46:37,410 --> 00:46:40,530 So these are examples of problems where Hidden Markov Models can 914 00:46:40,530 --> 00:46:43,500 be an incredibly powerful tool for AI to be 915 00:46:43,500 --> 00:46:46,380 able to use observed data about the world, 916 00:46:46,380 --> 00:46:51,000 to be able to observe some kind of hidden state. 917 00:46:51,000 --> 00:46:54,760 So that takes us to the projects related to this part of the course. 918 00:46:54,760 --> 00:46:57,640 So the first of the two projects is called Pagerank. 919 00:46:57,640 --> 00:47:01,200 This ask students to implement Google's page rank algorithm 920 00:47:01,200 --> 00:47:05,580 for determining which pages on the internet are important 921 00:47:05,580 --> 00:47:08,560 and which pages are not important. 922 00:47:08,560 --> 00:47:12,600 And it becomes an interesting question, of what does it mean for a web page 923 00:47:12,600 --> 00:47:17,280 to be important, and how, given the entire network of pages on the web, 924 00:47:17,280 --> 00:47:19,260 could you calculate which pages are important 925 00:47:19,260 --> 00:47:20,980 and which pages are not important? 926 00:47:20,980 --> 00:47:23,190 And it turns out that one way that you can do so 927 00:47:23,190 --> 00:47:26,370 is by using the Markov model structure, the Markov chain 928 00:47:26,370 --> 00:47:30,060 structure that I showed a little bit earlier, to try 929 00:47:30,060 --> 00:47:32,730 and map out how these pages relate to each other 930 00:47:32,730 --> 00:47:36,140 and how those pages connect to each other. 931 00:47:36,140 --> 00:47:38,630 The other one, which has a more scientific application, 932 00:47:38,630 --> 00:47:41,030 for those students who are interested in sciences, 933 00:47:41,030 --> 00:47:45,080 is interested in biology and other applications of these kinds of ideas, 934 00:47:45,080 --> 00:47:46,580 is called heredity. 935 00:47:46,580 --> 00:47:50,270 And this is asking students to do some genetic analysis using AI. 936 00:47:50,270 --> 00:47:53,180 To be able to calculate what's the likelihood 937 00:47:53,180 --> 00:47:56,150 that children or grandchildren of particular people 938 00:47:56,150 --> 00:47:59,960 are going to have certain genetic characteristics based on things 939 00:47:59,960 --> 00:48:04,540 we know or don't know about their parents, for example. 940 00:48:04,540 --> 00:48:08,300 And this is a great example of a distinction between observed data 941 00:48:08,300 --> 00:48:10,070 and actual information. 942 00:48:10,070 --> 00:48:14,150 That you might observe whether some genetic trait expresses itself 943 00:48:14,150 --> 00:48:16,523 inside of some human being. 944 00:48:16,523 --> 00:48:19,190 But that's what you observe, and you might not necessarily know, 945 00:48:19,190 --> 00:48:22,280 in an underlying sense, what are that person's genetics? 946 00:48:22,280 --> 00:48:25,220 But you still want to be able to reason about those genetics 947 00:48:25,220 --> 00:48:29,140 and connect the genetics of parents to the genetics of their children 948 00:48:29,140 --> 00:48:32,160 and to do those sorts of calculations. 949 00:48:32,160 --> 00:48:35,090 So what you're looking at here is a Bayesian network 950 00:48:35,090 --> 00:48:39,438 for doing this kind of analysis for the genetic relationship between parents 951 00:48:39,438 --> 00:48:40,230 and their children. 952 00:48:40,230 --> 00:48:42,320 And we show how you can use the same tools 953 00:48:42,320 --> 00:48:44,660 we were using in AI to be able to calculate 954 00:48:44,660 --> 00:48:48,778 if I'm going to miss my train, for example, to now determining 955 00:48:48,778 --> 00:48:51,320 whether or not the child is going to have some genetic trait, 956 00:48:51,320 --> 00:48:53,730 or what the likelihood of that is going to be. 957 00:48:53,730 --> 00:48:56,330 So we try to take these data structures and ideas 958 00:48:56,330 --> 00:48:58,530 and apply them to a number of different contexts. 959 00:48:58,530 --> 00:49:01,580 We first applied it to the context of analyzing the web 960 00:49:01,580 --> 00:49:03,160 and understanding the internet. 961 00:49:03,160 --> 00:49:07,230 Then we also apply it to the biological sciences, as well. 962 00:49:07,230 --> 00:49:11,610 So those that are the first three components of this seven part class. 963 00:49:11,610 --> 00:49:15,950 Its search problems, understanding knowledge, and then understanding 964 00:49:15,950 --> 00:49:18,300 uncertainty and how to deal with uncertainty. 965 00:49:18,300 --> 00:49:22,790 I'll pause now for any questions about anything so far. 966 00:49:22,790 --> 00:49:25,120 All right-- Oh, Ramon. 967 00:49:25,120 --> 00:49:27,350 Yeah, I see you have your hand raised. 968 00:49:27,350 --> 00:49:32,260 RAMON: I'd like to ask, for students who have never had experience with AI, 969 00:49:32,260 --> 00:49:36,940 how do they deal with these first three topics? 970 00:49:36,940 --> 00:49:42,863 What are the struggles and what kinds of things do they get right, right away? 971 00:49:42,863 --> 00:49:45,030 BRIAN YEW: So it varies a little bit by the project. 972 00:49:45,030 --> 00:49:49,860 In terms of where I see students struggling the most, 973 00:49:49,860 --> 00:49:53,610 some of it in the early projects is just with familiarity 974 00:49:53,610 --> 00:49:55,980 with certain Python data structures. 975 00:49:55,980 --> 00:49:59,220 That we assume that students will know how to use a list in Python, 976 00:49:59,220 --> 00:50:02,760 use a dictionary in Python, and even use a set in Python 977 00:50:02,760 --> 00:50:05,160 to be able to store and represent data. 978 00:50:05,160 --> 00:50:08,670 And sometimes students who may not have programmed too much in Python 979 00:50:08,670 --> 00:50:10,500 or may come from a different language don't 980 00:50:10,500 --> 00:50:15,210 know how to use those data structures as well as other students do. 981 00:50:15,210 --> 00:50:19,240 And so that's something we work with students on in our weekly sections, 982 00:50:19,240 --> 00:50:22,770 as well as in office hours, is just on building that comfortability 983 00:50:22,770 --> 00:50:27,330 with dealing with data structures in Python. 984 00:50:27,330 --> 00:50:31,410 And in addition to that, I would say that in some of the later ones, 985 00:50:31,410 --> 00:50:35,190 in particular with the project that I just talked about, 986 00:50:35,190 --> 00:50:38,400 some of the greater struggles are with the probability in the statistics. 987 00:50:38,400 --> 00:50:40,860 Because oftentimes, probability is not something 988 00:50:40,860 --> 00:50:42,520 these students have seen before. 989 00:50:42,520 --> 00:50:45,540 And as a result, calculating conditional probabilities 990 00:50:45,540 --> 00:50:49,270 and generating probability distributions is very new. 991 00:50:49,270 --> 00:50:51,452 And so it's sort of a two part process of one, 992 00:50:51,452 --> 00:50:53,160 making sure that students are comfortable 993 00:50:53,160 --> 00:50:54,990 with the mathematical fundamentals. 994 00:50:54,990 --> 00:50:59,160 And then applying those mathematical fundamentals and writing them in code. 995 00:50:59,160 --> 00:51:01,920 But we try to provide some distribution code to students 996 00:51:01,920 --> 00:51:03,420 to help students along with it. 997 00:51:03,420 --> 00:51:07,380 We give students example code of some implementations of these kinds of ideas 998 00:51:07,380 --> 00:51:09,870 that they can look at, all in the service of trying 999 00:51:09,870 --> 00:51:15,150 to help provide the necessary support so that students can then go and build out 1000 00:51:15,150 --> 00:51:17,580 these algorithms. 1001 00:51:17,580 --> 00:51:18,525 Ignacio? 1002 00:51:18,525 --> 00:51:25,770 IGNACIO: I see one question here that is a lot of like [INAUDIBLE].. 1003 00:51:25,770 --> 00:51:30,540 Can you just talk a little bit about this? 1004 00:51:30,540 --> 00:51:39,590 In Brazil, the students don't have [INAUDIBLE] about probability. 1005 00:51:39,590 --> 00:51:44,190 The high school students, we just teach about frequencies probability. 1006 00:51:44,190 --> 00:51:52,390 What is the probability of the number one [INAUDIBLE],, for example. 1007 00:51:52,390 --> 00:51:57,330 So we don't walk in a lot of conditional probability. 1008 00:51:57,330 --> 00:52:04,800 How do you deal with this situation in the course, and how about programming? 1009 00:52:04,800 --> 00:52:11,790 Is expected that these students take CS50 before, or just a little 1010 00:52:11,790 --> 00:52:16,190 bit knowing in Python is enough? 1011 00:52:16,190 --> 00:52:19,280 BRIAN YEW: Yes, so in terms of prior background that we expect, 1012 00:52:19,280 --> 00:52:22,940 programming and mathematical familiarity at the level that you would get 1013 00:52:22,940 --> 00:52:26,120 from taking CS50x is the prerequisite. 1014 00:52:26,120 --> 00:52:29,000 Some students get that through taking CS50x itself, 1015 00:52:29,000 --> 00:52:31,650 other students have had prior programming experience 1016 00:52:31,650 --> 00:52:33,900 in another language that can work. 1017 00:52:33,900 --> 00:52:37,820 As for the probability that is introduced in the class, 1018 00:52:37,820 --> 00:52:41,540 we don't expect that students have seen any of this notation before. 1019 00:52:41,540 --> 00:52:45,320 We do expect that they're familiar with algebra and variables and fractions 1020 00:52:45,320 --> 00:52:47,300 and those sorts of notation they might see. 1021 00:52:47,300 --> 00:52:49,760 But the probability specific notation, of what 1022 00:52:49,760 --> 00:52:52,490 is probability, what is conditional probability, 1023 00:52:52,490 --> 00:52:55,060 we don't assume any of that prior background. 1024 00:52:55,060 --> 00:52:57,980 And so we introduce that to students in the lecture itself. 1025 00:52:57,980 --> 00:53:00,080 And the way that we structure the class at Harvard 1026 00:53:00,080 --> 00:53:03,440 is that the lectures introduce the material conceptually and give students 1027 00:53:03,440 --> 00:53:04,730 their first look at it. 1028 00:53:04,730 --> 00:53:07,940 Then students attend a section led by a teaching fellow 1029 00:53:07,940 --> 00:53:11,030 where that teaching fellow, in this week in particular, 1030 00:53:11,030 --> 00:53:13,850 will spend some time going through the mathematical notation 1031 00:53:13,850 --> 00:53:17,390 again, reviewing it, making sure students are comfortable applying 1032 00:53:17,390 --> 00:53:20,540 the formulas that we show to students, in terms of how to calculate 1033 00:53:20,540 --> 00:53:22,902 conditional probability, for example. 1034 00:53:22,902 --> 00:53:25,610 And then they use that knowledge they've gotten from the sections 1035 00:53:25,610 --> 00:53:29,767 and from the lecture to then apply to the projects as well. 1036 00:53:29,767 --> 00:53:31,850 All right, so hopefully that answers that question 1037 00:53:31,850 --> 00:53:34,235 about the other mathematical prerequisites there. 1038 00:53:34,235 --> 00:53:35,860 Ramon, you still have your hand raised. 1039 00:53:35,860 --> 00:53:38,862 Do you have another question, or is that leftover from before? 1040 00:53:38,862 --> 00:53:40,320 RAMON: Yeah, I have a question. 1041 00:53:40,320 --> 00:53:44,330 My question is you said that some students come 1042 00:53:44,330 --> 00:53:47,550 to the class with some lacks of knowledge in mathematics 1043 00:53:47,550 --> 00:53:48,780 and also programming. 1044 00:53:48,780 --> 00:53:54,030 And the question I'm going to ask comes from a personal struggle 1045 00:53:54,030 --> 00:53:58,410 that I had in my major at the University. 1046 00:53:58,410 --> 00:54:01,460 Because I was struggling with calculus and also logic, 1047 00:54:01,460 --> 00:54:05,460 like propositional logic, and in these two subjects. 1048 00:54:05,460 --> 00:54:11,490 And I asked the teacher, what are the uses for these two subjects? 1049 00:54:11,490 --> 00:54:12,940 And they said, oh, AI. 1050 00:54:12,940 --> 00:54:16,140 And I would like to ask, if in the beginning of the course, 1051 00:54:16,140 --> 00:54:20,640 are these students expected to know a logic, 1052 00:54:20,640 --> 00:54:23,940 propositional logic, calculus, discrete mathematics? 1053 00:54:23,940 --> 00:54:29,140 Or is it approach leading the course, if not in the beginning? 1054 00:54:29,140 --> 00:54:30,570 BRIAN YEW: No calculus. 1055 00:54:30,570 --> 00:54:35,670 In terms of discrete mathematics, we would expect like algorithmic thinking 1056 00:54:35,670 --> 00:54:36,780 to the level of CS50. 1057 00:54:36,780 --> 00:54:41,340 Like, CS50 introduces the idea of, OK this is a linear algorithm, 1058 00:54:41,340 --> 00:54:44,130 or this is a n squared algorithm, for example. 1059 00:54:44,130 --> 00:54:46,510 Those are topics and ideas that do come up, 1060 00:54:46,510 --> 00:54:49,320 that it's helpful to have some familiarity with, just in terms 1061 00:54:49,320 --> 00:54:51,240 of trying to write efficient code. 1062 00:54:51,240 --> 00:54:55,050 As for propositional logic, we don't assume any of that prior background. 1063 00:54:55,050 --> 00:54:57,480 We start at the beginning with truth values, 1064 00:54:57,480 --> 00:55:00,690 with introducing students to logical connectives like 1065 00:55:00,690 --> 00:55:05,220 and, and or, and not, as well as more complex ones like logical implication 1066 00:55:05,220 --> 00:55:07,020 that many haven't seen before. 1067 00:55:07,020 --> 00:55:10,350 And we walk students through that from the beginning. 1068 00:55:10,350 --> 00:55:11,210 All right. 1069 00:55:11,210 --> 00:55:12,960 Let's go ahead and go onto the next topic. 1070 00:55:12,960 --> 00:55:16,420 But I can certainly take more questions as we go. 1071 00:55:16,420 --> 00:55:20,070 So the next big topic of AI in this class is optimization. 1072 00:55:20,070 --> 00:55:22,830 So the idea here is that we want AI, only 1073 00:55:22,830 --> 00:55:26,820 to find a good solution to a problem, but to find the best possible solution 1074 00:55:26,820 --> 00:55:31,170 to the problem, by exploring what possible solutions are out there. 1075 00:55:31,170 --> 00:55:35,770 So this is useful in projects like trying to plan something, for instance. 1076 00:55:35,770 --> 00:55:39,602 So here, a problem might be if you're planning a city 1077 00:55:39,602 --> 00:55:41,310 and there are all these houses and you're 1078 00:55:41,310 --> 00:55:43,890 trying to decide, where should the hospitals be? 1079 00:55:43,890 --> 00:55:46,200 Ideally, you want the hospitals so that they're 1080 00:55:46,200 --> 00:55:48,420 close to where people are living. 1081 00:55:48,420 --> 00:55:51,900 You don't want necessarily-- if you only have two hospitals in the city, 1082 00:55:51,900 --> 00:55:54,180 you don't want them both in one corner of the city 1083 00:55:54,180 --> 00:55:56,460 where it's going to be difficult for people on the other side of the city 1084 00:55:56,460 --> 00:55:57,420 to get to. 1085 00:55:57,420 --> 00:56:01,150 So what algorithms could you use to optimize that sort of placement? 1086 00:56:01,150 --> 00:56:03,150 These are the kinds of questions that we answer. 1087 00:56:03,150 --> 00:56:07,920 And oftentimes, these problems can be solved via some form of hill climbing. 1088 00:56:07,920 --> 00:56:11,400 That you have a whole bunch of possible options, each of which 1089 00:56:11,400 --> 00:56:14,280 are varying degrees of good or optimal. 1090 00:56:14,280 --> 00:56:17,190 And by exploring what are your neighbors, 1091 00:56:17,190 --> 00:56:19,590 you can try and always go to a neighbor that 1092 00:56:19,590 --> 00:56:22,182 is better than your current position. 1093 00:56:22,182 --> 00:56:24,390 And I'm glossing over some of the finer details here, 1094 00:56:24,390 --> 00:56:26,820 but that's just the general idea of this algorithm. 1095 00:56:26,820 --> 00:56:30,960 That if I have this landscape of places that I can explore, what I want to do 1096 00:56:30,960 --> 00:56:34,680 is try to explore through this space in order 1097 00:56:34,680 --> 00:56:38,520 to find where the maximum is by always going to whichever of my neighbors 1098 00:56:38,520 --> 00:56:43,870 is taller than I am in order to continue to try to climb higher and higher. 1099 00:56:43,870 --> 00:56:46,180 Someone in the chat asked about the A* algorithm. 1100 00:56:46,180 --> 00:56:50,380 We introduce A* algorithm in the very first lecture about search. 1101 00:56:50,380 --> 00:56:53,950 It goes nicely with topics like depth-first search 1102 00:56:53,950 --> 00:56:57,640 and breadth-first search because it solves similar types of search problems 1103 00:56:57,640 --> 00:57:03,020 and uses heuristics to try to do so efficiently. 1104 00:57:03,020 --> 00:57:06,200 We talk about the problems that you might encounter with hill climbing. 1105 00:57:06,200 --> 00:57:08,150 In particular, with this particular layout, 1106 00:57:08,150 --> 00:57:13,220 you might get stuck at this shoulder or this sort of flat area 1107 00:57:13,220 --> 00:57:16,445 inside of this state space landscape, as it's called, 1108 00:57:16,445 --> 00:57:19,070 where you're on one of these, but neither one of your neighbors 1109 00:57:19,070 --> 00:57:19,870 is higher than you. 1110 00:57:19,870 --> 00:57:22,120 So you don't really know which direction to travel in. 1111 00:57:22,120 --> 00:57:24,080 And we talk about some of the algorithms that 1112 00:57:24,080 --> 00:57:27,890 can be used to solve this type of problem, as well. 1113 00:57:27,890 --> 00:57:31,680 And then, and here's where some of the algebraic familiarity comes in handy-- 1114 00:57:31,680 --> 00:57:34,860 we talk about a type of programming called linear programming. 1115 00:57:34,860 --> 00:57:37,670 Linear programming is all about solving problems 1116 00:57:37,670 --> 00:57:42,080 by writing mathematical equations that you can solve in order 1117 00:57:42,080 --> 00:57:43,980 to get what the answer is going to be. 1118 00:57:43,980 --> 00:57:47,922 So you have some function that you're trying to make as big as possible. 1119 00:57:47,922 --> 00:57:49,130 You're trying to maximize it. 1120 00:57:49,130 --> 00:57:52,320 Or you're trying to minimize it as much as possible. 1121 00:57:52,320 --> 00:57:54,800 But you're trying to do so subject to constraints. 1122 00:57:54,800 --> 00:57:57,740 So this might have business implications, if for example, you're 1123 00:57:57,740 --> 00:57:59,540 trying to maximize your profits, but you're 1124 00:57:59,540 --> 00:58:01,520 constrained by how many employees you have 1125 00:58:01,520 --> 00:58:04,220 or you're constrained by how much area you have 1126 00:58:04,220 --> 00:58:07,140 or you're constrained by what resources you have, for example. 1127 00:58:07,140 --> 00:58:09,830 So there are a lot of artificial intelligence problems 1128 00:58:09,830 --> 00:58:12,920 that can be solved just by writing some equations. 1129 00:58:12,920 --> 00:58:15,770 And then, it would be pretty tedious for us, the humans, 1130 00:58:15,770 --> 00:58:17,490 to solve these equations. 1131 00:58:17,490 --> 00:58:20,570 But you can give it to a computer that has algorithms for solving 1132 00:58:20,570 --> 00:58:22,280 these kinds of equations as well. 1133 00:58:22,280 --> 00:58:24,140 And we introduce students to some libraries 1134 00:58:24,140 --> 00:58:27,380 that are good at working with linear programs 1135 00:58:27,380 --> 00:58:29,810 so that they can give the computer some equations 1136 00:58:29,810 --> 00:58:34,870 and the computer will solve the optimization problem for them. 1137 00:58:34,870 --> 00:58:36,770 And then finally, in this part of the course, 1138 00:58:36,770 --> 00:58:40,600 we talk about a particular type of problem called constraint satisfaction 1139 00:58:40,600 --> 00:58:41,215 problems. 1140 00:58:41,215 --> 00:58:43,090 And so these are problems where you're trying 1141 00:58:43,090 --> 00:58:48,220 to figure out what the answer is, subject to certain constraints 1142 00:58:48,220 --> 00:58:49,490 on what your answer can be. 1143 00:58:49,490 --> 00:58:52,840 So if you've ever solved a sudoku puzzle, it's very much like that idea 1144 00:58:52,840 --> 00:58:56,020 where you're trying to place numbers in the grid, but there are constraints. 1145 00:58:56,020 --> 00:58:59,132 Like you can't have the same number in the same row or in the same column. 1146 00:58:59,132 --> 00:59:01,090 And in a real world setting, this might come up 1147 00:59:01,090 --> 00:59:04,090 for a college or university in the context of something 1148 00:59:04,090 --> 00:59:05,598 like exam scheduling. 1149 00:59:05,598 --> 00:59:08,890 Where you have all of these students who are all enrolled in different classes. 1150 00:59:08,890 --> 00:59:11,170 You need to schedule final exams for everyone, 1151 00:59:11,170 --> 00:59:13,000 but you don't want any one student to have 1152 00:59:13,000 --> 00:59:15,827 to be in two exams at the same time because that 1153 00:59:15,827 --> 00:59:17,160 might cause scheduling problems. 1154 00:59:17,160 --> 00:59:20,680 So you need to figure out when all the exams should be, in such a way 1155 00:59:20,680 --> 00:59:23,400 that all of these constraints are satisfied. 1156 00:59:23,400 --> 00:59:25,277 And so this kind of exam scheduling where 1157 00:59:25,277 --> 00:59:27,110 students are taking these classes, they need 1158 00:59:27,110 --> 00:59:31,780 to figure out what exam slot they should go into, is one example of this. 1159 00:59:31,780 --> 00:59:34,893 And we talk through how you might solve that. 1160 00:59:34,893 --> 00:59:37,060 And then we extend that to the project students work 1161 00:59:37,060 --> 00:59:41,090 on in this part of the class, which is writing a crossword puzzle generator. 1162 00:59:41,090 --> 00:59:43,090 So it's just going to generate crossword puzzles 1163 00:59:43,090 --> 00:59:48,370 to figure out what words need to go where, pursuant to certain constraints. 1164 00:59:48,370 --> 00:59:51,432 The constraints in this case being that the word going across 1165 00:59:51,432 --> 00:59:54,140 and the word going vertically, if they intersect with each other, 1166 00:59:54,140 --> 00:59:56,770 they need to have a matching letter there, for example. 1167 00:59:56,770 --> 01:00:00,500 So we talk about those constraints and how to solve them. 1168 01:00:00,500 --> 01:00:02,900 And so that first part of the class really 1169 01:00:02,900 --> 01:00:08,570 introduces students to a wide variety of topics in artificial intelligence 1170 01:00:08,570 --> 01:00:09,890 more broadly. 1171 01:00:09,890 --> 01:00:13,640 In the latter part of the class, the last three topics that we talk about, 1172 01:00:13,640 --> 01:00:17,100 those all start to get into machine learning itself. 1173 01:00:17,100 --> 01:00:20,720 And so machine learning, you can think of as in some ways 1174 01:00:20,720 --> 01:00:22,680 a subset of artificial intelligence. 1175 01:00:22,680 --> 01:00:24,860 Artificial intelligence, more generally, is 1176 01:00:24,860 --> 01:00:27,770 about computers that are able to do things 1177 01:00:27,770 --> 01:00:32,480 that are considered to be rational or human-like or intelligent in some way. 1178 01:00:32,480 --> 01:00:35,840 Machine learning is a way of doing that that involves 1179 01:00:35,840 --> 01:00:40,130 having the computer teach itself how to perform a task based 1180 01:00:40,130 --> 01:00:41,870 on access to some data, usually. 1181 01:00:41,870 --> 01:00:44,150 That the computer has access to some information 1182 01:00:44,150 --> 01:00:46,160 or has access to some experiences. 1183 01:00:46,160 --> 01:00:48,470 And using those experiences, the computer 1184 01:00:48,470 --> 01:00:52,340 teaches itself how to perform a task without being given 1185 01:00:52,340 --> 01:00:56,030 explicit instructions for how to do so. 1186 01:00:56,030 --> 01:00:59,840 So the next part of the class explores these sorts of ideas. 1187 01:00:59,840 --> 01:01:05,070 Explorers learning, and how it is the computers learn information. 1188 01:01:05,070 --> 01:01:09,410 And so we start with some of the simpler algorithms for doing so. 1189 01:01:09,410 --> 01:01:13,338 One of the simplest algorithms for a problem of classification, 1190 01:01:13,338 --> 01:01:15,380 and classification is a problem where you're just 1191 01:01:15,380 --> 01:01:19,490 trying to take something and put it into one category or another, 1192 01:01:19,490 --> 01:01:21,950 is just called Nearest-Neighbor Classification. 1193 01:01:21,950 --> 01:01:23,960 And in Nearest-Neighbor Classification you 1194 01:01:23,960 --> 01:01:28,910 classify something, like in this case, classifying a point as red or blue, 1195 01:01:28,910 --> 01:01:32,480 by determining what other points it's close to. 1196 01:01:32,480 --> 01:01:35,270 And if this white point is close to a whole bunch of red points, 1197 01:01:35,270 --> 01:01:38,180 then we might conclude that that point should be red. 1198 01:01:38,180 --> 01:01:41,240 And so we talk about other learning algorithms 1199 01:01:41,240 --> 01:01:46,010 that computers can use to solve these kinds of classification problems 1200 01:01:46,010 --> 01:01:50,330 where the computer is trying to put something into one or more categories. 1201 01:01:50,330 --> 01:01:53,690 And this comes up all of the time in real world applications. 1202 01:01:53,690 --> 01:01:57,350 Notably, one thing we talk about is something like email spam detection. 1203 01:01:57,350 --> 01:02:00,410 How does your email filter know whether your email is spam 1204 01:02:00,410 --> 01:02:03,170 or not, to determine what to put into your spam filter? 1205 01:02:03,170 --> 01:02:06,020 Well, what it does is it uses access to large amounts of data. 1206 01:02:06,020 --> 01:02:09,200 It knows what emails are spam and have been spam in the past. 1207 01:02:09,200 --> 01:02:11,400 It knows what your good emails have been. 1208 01:02:11,400 --> 01:02:13,790 And so by taking advantage of that data, the computer 1209 01:02:13,790 --> 01:02:18,530 can then classify a new email as either a spam email or not spam email, 1210 01:02:18,530 --> 01:02:20,010 for example. 1211 01:02:20,010 --> 01:02:23,390 And so that's just one instance of how a computer might try to classify 1212 01:02:23,390 --> 01:02:25,430 something into one category or another. 1213 01:02:25,430 --> 01:02:27,830 But it comes up all the time across machine learning. 1214 01:02:27,830 --> 01:02:30,380 This more general problem of, can you put something 1215 01:02:30,380 --> 01:02:34,150 into one category or another. 1216 01:02:34,150 --> 01:02:36,475 When dealing with more numerical data, especially 1217 01:02:36,475 --> 01:02:38,350 if you're familiar with statistics, you might 1218 01:02:38,350 --> 01:02:40,510 be familiar with regression, where we're trying 1219 01:02:40,510 --> 01:02:43,780 to predict some sort of trend line for what this data looks like 1220 01:02:43,780 --> 01:02:46,960 and along where this data falls. 1221 01:02:46,960 --> 01:02:49,390 And we're trying to draw some line that tries 1222 01:02:49,390 --> 01:02:52,720 to be as close as possible to all of these data points. 1223 01:02:52,720 --> 01:02:55,510 And so we talk about strategies that you might do that. 1224 01:02:55,510 --> 01:02:58,870 And regression is another popular topic in machine learning, 1225 01:02:58,870 --> 01:03:02,140 for trying to figure out efficient ways of calculating that line 1226 01:03:02,140 --> 01:03:05,070 and how to make it as accurate as possible. 1227 01:03:05,070 --> 01:03:06,820 But we do have to be a little bit careful. 1228 01:03:06,820 --> 01:03:08,528 In the world of machine learning, we want 1229 01:03:08,528 --> 01:03:11,140 to be careful not to be too accurate. 1230 01:03:11,140 --> 01:03:13,780 Which seems maybe counter intuitive at first. 1231 01:03:13,780 --> 01:03:17,120 Like, don't you want to always be as accurate as possible? 1232 01:03:17,120 --> 01:03:22,450 But if I were going to draw some line or curve that maximized accuracy 1233 01:03:22,450 --> 01:03:26,890 according to these points here, I might draw a line like this. 1234 01:03:26,890 --> 01:03:30,280 That's just sort of jagged, and is what we might call over 1235 01:03:30,280 --> 01:03:32,440 fitting on the existing data. 1236 01:03:32,440 --> 01:03:34,180 It's true that it's very accurate. 1237 01:03:34,180 --> 01:03:37,370 It's connecting all of the data points that I have here. 1238 01:03:37,370 --> 01:03:40,120 But it's not going to generalize very well. 1239 01:03:40,120 --> 01:03:42,970 It's not going to do a very good job of generally predicting 1240 01:03:42,970 --> 01:03:45,910 what the overall shape or what the overall trend of this data 1241 01:03:45,910 --> 01:03:48,982 is, because data always has some noise to it. 1242 01:03:48,982 --> 01:03:51,940 But it's not that there's actually this trend where things are going up 1243 01:03:51,940 --> 01:03:53,650 and down and up and down over and over. 1244 01:03:53,650 --> 01:03:55,550 There may just be some natural noise. 1245 01:03:55,550 --> 01:03:57,430 And yes, exactly as the chat is pointing out. 1246 01:03:57,430 --> 01:04:01,510 Now this model is not going to be very good for predicting things. 1247 01:04:01,510 --> 01:04:03,580 And so it's not enough just to say, let's 1248 01:04:03,580 --> 01:04:07,150 make our model as accurate as possible based on the data that we have. 1249 01:04:07,150 --> 01:04:09,970 We want to make our data, our model, as accurate 1250 01:04:09,970 --> 01:04:14,170 as possible while still letting it generalize to new data 1251 01:04:14,170 --> 01:04:16,320 that we've never seen before. 1252 01:04:16,320 --> 01:04:20,260 And so we introduce students to this idea of over fitting on data 1253 01:04:20,260 --> 01:04:22,932 and how to think about that, too. 1254 01:04:22,932 --> 01:04:25,140 These are just some of the types of machine learning. 1255 01:04:25,140 --> 01:04:28,020 There are other categories of machine learning, we talk about too. 1256 01:04:28,020 --> 01:04:30,670 One example of that is reinforcement learning. 1257 01:04:30,670 --> 01:04:34,500 So this is a computer that is learning through experiences. 1258 01:04:34,500 --> 01:04:37,170 It learns by trying something, and if it works, 1259 01:04:37,170 --> 01:04:39,328 it learns to do more of that in the future. 1260 01:04:39,328 --> 01:04:42,120 And if it doesn't work, it learns to do less of that in the future. 1261 01:04:42,120 --> 01:04:44,520 You might imagine that shopping websites like Amazon 1262 01:04:44,520 --> 01:04:47,940 use this to recommend products to you that it thinks you might want to buy. 1263 01:04:47,940 --> 01:04:50,100 It might have some recommendation algorithm 1264 01:04:50,100 --> 01:04:52,037 that tries to suggest something to you. 1265 01:04:52,037 --> 01:04:54,870 And if you buy it, then it knows that it made a good recommendation. 1266 01:04:54,870 --> 01:04:58,180 So it can do more of those kinds of recommendations in the future. 1267 01:04:58,180 --> 01:05:03,600 But if you don't, if you don't try it, or if you don't buy the product, 1268 01:05:03,600 --> 01:05:07,320 then the algorithm maybe learns that that wasn't such a good recommendation, 1269 01:05:07,320 --> 01:05:11,040 and it can learn not to do that in the future. 1270 01:05:11,040 --> 01:05:12,130 Yes, to answer a question. 1271 01:05:12,130 --> 01:05:14,430 We do talk about a couple of different loss functions. 1272 01:05:14,430 --> 01:05:17,340 We don't get too much into the mathematical details of it. 1273 01:05:17,340 --> 01:05:22,860 But certainly I think at least L2 loss, L1 loss 1274 01:05:22,860 --> 01:05:26,100 are loss functions that we cover when talking about this a little bit more 1275 01:05:26,100 --> 01:05:29,212 generally. 1276 01:05:29,212 --> 01:05:31,420 So with reinforcement learning, we introduce students 1277 01:05:31,420 --> 01:05:36,880 to yet another data structure that's named after Markov, the Markov Decision 1278 01:05:36,880 --> 01:05:39,550 Process, which is a data structure where basically you 1279 01:05:39,550 --> 01:05:41,200 have a bunch of different options. 1280 01:05:41,200 --> 01:05:44,470 And no matter what option you take, you're given some sort of reward 1281 01:05:44,470 --> 01:05:45,782 based on that option. 1282 01:05:45,782 --> 01:05:47,740 Maybe that reward is positive if something good 1283 01:05:47,740 --> 01:05:50,710 happened, like the person bought the product you recommended. 1284 01:05:50,710 --> 01:05:54,960 Or maybe it's negative, if the person didn't buy the product you recommended. 1285 01:05:54,960 --> 01:05:57,760 And based on those rewards, you can begin 1286 01:05:57,760 --> 01:06:02,068 to learn something about what the right actions or what the right choices are. 1287 01:06:02,068 --> 01:06:04,360 And then a final type of machine learning we talk about 1288 01:06:04,360 --> 01:06:06,217 is unsupervised learning. 1289 01:06:06,217 --> 01:06:08,800 And so this was brought up in a question a little bit earlier. 1290 01:06:08,800 --> 01:06:11,920 But one of the popular algorithms in unsupervised learning 1291 01:06:11,920 --> 01:06:14,710 are the more general category of clustering algorithms. 1292 01:06:14,710 --> 01:06:17,200 I have a whole bunch of data, and I want to bunch them up 1293 01:06:17,200 --> 01:06:18,220 into different clusters. 1294 01:06:18,220 --> 01:06:24,040 So I've collected a whole bunch of samples of DNA, for example. 1295 01:06:24,040 --> 01:06:27,708 I want to break them down into clusters of related DNA strands. 1296 01:06:27,708 --> 01:06:31,000 Or I've collected a whole bunch of data from people, and I want to group people 1297 01:06:31,000 --> 01:06:32,380 into different categories. 1298 01:06:32,380 --> 01:06:34,780 There are a whole bunch of clustering algorithms. 1299 01:06:34,780 --> 01:06:37,010 We introduce students to k means clustering, 1300 01:06:37,010 --> 01:06:39,760 if you're familiar with that, as one of the algorithms that can be 1301 01:06:39,760 --> 01:06:43,385 used in order to cluster data together. 1302 01:06:43,385 --> 01:06:45,260 And there's a lot of mathematical detail that 1303 01:06:45,260 --> 01:06:46,940 goes into a lot of these algorithms. 1304 01:06:46,940 --> 01:06:49,310 But we don't expect that students are able to write 1305 01:06:49,310 --> 01:06:52,700 all of those mathematical details because we assume a little bit less 1306 01:06:52,700 --> 01:06:54,350 prior mathematical background. 1307 01:06:54,350 --> 01:06:56,390 But we do introduce students to tools that they 1308 01:06:56,390 --> 01:06:59,570 can use that implement some of these algorithms for them. 1309 01:06:59,570 --> 01:07:04,250 So something like Scikit-learn is a popular Python package 1310 01:07:04,250 --> 01:07:05,895 for doing machine learning. 1311 01:07:05,895 --> 01:07:09,020 In fact, one of our former teaching fellows for the artificial intelligence 1312 01:07:09,020 --> 01:07:11,390 class now works with Scikit-learn and works 1313 01:07:11,390 --> 01:07:14,650 on developing some of those software tools there. 1314 01:07:14,650 --> 01:07:18,920 And so this helps to do some of the data processing and data analysis 1315 01:07:18,920 --> 01:07:21,440 and creating some of the machine learning 1316 01:07:21,440 --> 01:07:23,390 models that are introduced in this course 1317 01:07:23,390 --> 01:07:26,880 without students having to write all of the mathematics themselves. 1318 01:07:26,880 --> 01:07:29,810 And so we use this, in particular, in one of our projects 1319 01:07:29,810 --> 01:07:31,220 which is about shopping. 1320 01:07:31,220 --> 01:07:34,250 It's about, can you predict based on data, 1321 01:07:34,250 --> 01:07:37,370 whether or not the user is actually going to make a purchase 1322 01:07:37,370 --> 01:07:38,480 or not make a purchase. 1323 01:07:38,480 --> 01:07:40,820 And so this has a lot of business implications. 1324 01:07:40,820 --> 01:07:44,120 A lot of shopping businesses are going to do something along these lines 1325 01:07:44,120 --> 01:07:47,800 in order to get more data and to make these kinds of predictions. 1326 01:07:47,800 --> 01:07:50,900 And so we give the students a sample of some real world data 1327 01:07:50,900 --> 01:07:54,050 about when users have bought products and when they haven't and asked 1328 01:07:54,050 --> 01:07:57,950 them to use Scikit-learn to be able to create a machine learning model to try 1329 01:07:57,950 --> 01:08:01,240 to predict this kind of thing as well. 1330 01:08:01,240 --> 01:08:03,840 We also introduce students to get another game. 1331 01:08:03,840 --> 01:08:08,260 Nim is a game where you're trying to remove objects from a collection, 1332 01:08:08,260 --> 01:08:11,440 and you're trying not to be the last one to remove an object. 1333 01:08:11,440 --> 01:08:17,160 And this is a game where instead of having students implement or tell 1334 01:08:17,160 --> 01:08:20,069 the computer exactly what to do and give it the Minimax algorithm 1335 01:08:20,069 --> 01:08:24,180 to solve it completely, we just let the computer teach itself how to play Nim. 1336 01:08:24,180 --> 01:08:29,069 Let it play 10,000 games of Nim against itself, and every time it plays a game, 1337 01:08:29,069 --> 01:08:32,370 when it wins, it learns what to do next time, and every time it loses, 1338 01:08:32,370 --> 01:08:34,260 it learns what not to do next time. 1339 01:08:34,260 --> 01:08:36,660 And this is an example of how reinforcement learning can 1340 01:08:36,660 --> 01:08:41,319 be used in order to be able to perform a task, 1341 01:08:41,319 --> 01:08:43,529 even if it didn't know how to do so before. 1342 01:08:43,529 --> 01:08:45,510 And there are great examples of reinforcement 1343 01:08:45,510 --> 01:08:46,593 learning across the board. 1344 01:08:46,593 --> 01:08:48,870 It's especially popular in robotics. 1345 01:08:48,870 --> 01:08:51,149 Teaching a robot how to do something, like walk, 1346 01:08:51,149 --> 01:08:53,340 it's an incredibly complicated task. 1347 01:08:53,340 --> 01:08:56,910 So instead, people usually will tell the robot to teach itself how to walk. 1348 01:08:56,910 --> 01:09:00,000 Like just tell it to try things, and if it's walking more successfully, 1349 01:09:00,000 --> 01:09:02,250 have it do more of that in the future, and if not, do 1350 01:09:02,250 --> 01:09:03,870 less of that in the future. 1351 01:09:03,870 --> 01:09:05,330 There is a great YouTube video. 1352 01:09:05,330 --> 01:09:07,080 I don't have it up now, but if someone can 1353 01:09:07,080 --> 01:09:11,580 find it and paste it in the chat, of a robot that learns to flip pancakes. 1354 01:09:11,580 --> 01:09:13,830 The robot starts out not knowing how to flip pancakes. 1355 01:09:13,830 --> 01:09:16,649 But over time, by trying it out again and again, and you 1356 01:09:16,649 --> 01:09:18,899 can see some of its early failures, which are not very 1357 01:09:18,899 --> 01:09:20,880 good attempts at flipping pancakes-- 1358 01:09:20,880 --> 01:09:22,710 thank you, Arturo for pasting that link. 1359 01:09:22,710 --> 01:09:27,000 Eventually, the robot learns how to flip a pancake very successfully. 1360 01:09:27,000 --> 01:09:30,240 And so that too is an example of using motion capture 1361 01:09:30,240 --> 01:09:34,240 and reinforcement learning to try to solve some of these problems too. 1362 01:09:34,240 --> 01:09:37,470 A pause now if there are any questions about anything. 1363 01:09:37,470 --> 01:09:38,999 Joe, I see your hand is raised. 1364 01:09:38,999 --> 01:09:44,040 JOE: Yes, I want to clarify my understand, distinction. 1365 01:09:44,040 --> 01:09:48,609 So machine learning and deep learning, versus the previous section. 1366 01:09:48,609 --> 01:09:54,210 So can we assume that all the other models outside of machine learning 1367 01:09:54,210 --> 01:09:58,350 will always have explicit rules, the full algorithm will be written, 1368 01:09:58,350 --> 01:10:03,170 you don't need training data, or you don't need a lot of data to train it. 1369 01:10:03,170 --> 01:10:04,780 It does not improve on its own. 1370 01:10:04,780 --> 01:10:07,260 Is that safe to assume? 1371 01:10:07,260 --> 01:10:10,222 BRIAN YEW: That's often the case. 1372 01:10:10,222 --> 01:10:12,180 I want to stray away from saying that's exactly 1373 01:10:12,180 --> 01:10:13,360 the way it's going to be all the time. 1374 01:10:13,360 --> 01:10:15,510 But generally, machine learning is characterized 1375 01:10:15,510 --> 01:10:18,600 by algorithms that have access to data. 1376 01:10:18,600 --> 01:10:21,480 And then using that data, the algorithm can get better. 1377 01:10:21,480 --> 01:10:25,260 So with more data, you can end up with a more accurate algorithm. 1378 01:10:25,260 --> 01:10:29,130 And that contrasts with something like the Minimax algorithm 1379 01:10:29,130 --> 01:10:32,100 we saw or some of the search algorithms we saw, where all you need 1380 01:10:32,100 --> 01:10:34,950 is the problem you're trying to solve, and we try and figure 1381 01:10:34,950 --> 01:10:36,960 out how to solve the problem using that. 1382 01:10:36,960 --> 01:10:40,890 As opposed to having access to existing banks of data 1383 01:10:40,890 --> 01:10:42,720 that we use to learn from. 1384 01:10:42,720 --> 01:10:45,090 So usually machine learning is going to be characterized 1385 01:10:45,090 --> 01:10:49,080 by having access to information and prior data 1386 01:10:49,080 --> 01:10:52,620 and drawing conclusions based on that data that's available. 1387 01:10:52,620 --> 01:10:55,560 As for deep learning, specifically, deep learning 1388 01:10:55,560 --> 01:10:57,510 is a subset of machine learning. 1389 01:10:57,510 --> 01:10:59,820 It's a particular kind of machine learning. 1390 01:10:59,820 --> 01:11:03,430 And when we talk about neural networks, which is the next topic, 1391 01:11:03,430 --> 01:11:05,830 I'll talk about that briefly as well. 1392 01:11:05,830 --> 01:11:10,350 So that leads in quite nicely to the next topic. 1393 01:11:10,350 --> 01:11:12,390 Classification and clustering. 1394 01:11:12,390 --> 01:11:13,940 Oh, data pre-processing. 1395 01:11:13,940 --> 01:11:16,920 Yeah, for some of the projects, students do have to take some data 1396 01:11:16,920 --> 01:11:19,800 and then pre process that and get it into a format 1397 01:11:19,800 --> 01:11:22,980 that the machine learning models will understand, that's true. 1398 01:11:22,980 --> 01:11:25,650 In this topic, machine learning, it will also 1399 01:11:25,650 --> 01:11:30,040 be true in the neural networks part of the course as well. 1400 01:11:30,040 --> 01:11:33,250 Not extensive, the data is mostly pretty clean. 1401 01:11:33,250 --> 01:11:36,700 But there is some work that still needs to be done. 1402 01:11:36,700 --> 01:11:40,150 So this leads into the next part of what the artificial intelligence class talks 1403 01:11:40,150 --> 01:11:42,640 about, which is about neural networks. 1404 01:11:42,640 --> 01:11:45,870 Neural networks are a tool that are used in machine learning, 1405 01:11:45,870 --> 01:11:48,130 and they have become incredibly powerful. 1406 01:11:48,130 --> 01:11:50,200 They're used for so many different problems. 1407 01:11:50,200 --> 01:11:53,230 Now for clustering, they're used for classification, 1408 01:11:53,230 --> 01:11:55,258 they're used for reinforcement learning. 1409 01:11:55,258 --> 01:11:57,550 So there are many, many applications of neural networks 1410 01:11:57,550 --> 01:12:00,250 to a wide variety of different problems, and so we 1411 01:12:00,250 --> 01:12:01,810 spend some time talking about them. 1412 01:12:01,810 --> 01:12:04,690 Now I should note that really understanding 1413 01:12:04,690 --> 01:12:08,680 exactly how the neural network works requires some higher level math, 1414 01:12:08,680 --> 01:12:10,420 requires some linear algebra. 1415 01:12:10,420 --> 01:12:16,240 And so we don't go into all that mathematical sophistication, 1416 01:12:16,240 --> 01:12:18,340 just in this introductory course. 1417 01:12:18,340 --> 01:12:21,010 If this is something that students are interested in, though, 1418 01:12:21,010 --> 01:12:23,950 you can find online many good online resources and courses 1419 01:12:23,950 --> 01:12:28,630 for them going deeper into deep learning itself and looking at neural networks 1420 01:12:28,630 --> 01:12:29,530 in particular. 1421 01:12:29,530 --> 01:12:32,890 You could spend entire courses that just talk about neural networks 1422 01:12:32,890 --> 01:12:34,430 and deep learning. 1423 01:12:34,430 --> 01:12:37,390 There's a great one from MIT, there is one on Coursera 1424 01:12:37,390 --> 01:12:39,770 as well, I'm forgetting their exact names. 1425 01:12:39,770 --> 01:12:41,620 But some great classes that dive much deeper 1426 01:12:41,620 --> 01:12:43,700 than we do on this particular topic. 1427 01:12:43,700 --> 01:12:48,320 We introduced this in just a single week at a more higher level, 1428 01:12:48,320 --> 01:12:51,520 so that students can see it and still build neural networks of their own, 1429 01:12:51,520 --> 01:12:55,977 but without going into nearly the same mathematical details. 1430 01:12:55,977 --> 01:12:58,810 And the principle for neural networks is really inspired by biology. 1431 01:12:58,810 --> 01:13:02,710 That in human brains, we have neurons that are connected with each other, 1432 01:13:02,710 --> 01:13:06,610 and those neurons pass information from one neuron to another 1433 01:13:06,610 --> 01:13:08,680 so that one neuron might be activated and then 1434 01:13:08,680 --> 01:13:13,500 pass that activation onto some other neuron, for example. 1435 01:13:13,500 --> 01:13:16,930 And what neural networks are, or artificial neural networks, 1436 01:13:16,930 --> 01:13:19,870 in this case, are the same idea but applied in computers. 1437 01:13:19,870 --> 01:13:22,840 Rather than use a literal neuron, we're going 1438 01:13:22,840 --> 01:13:24,730 to use an artificial neuron, which we usually 1439 01:13:24,730 --> 01:13:27,460 represent which just a circular node. 1440 01:13:27,460 --> 01:13:30,352 And those artificial neurons are connected to each other. 1441 01:13:30,352 --> 01:13:33,310 Thank you [INAUDIBLE] for pasting the link to some of the deep learning 1442 01:13:33,310 --> 01:13:36,120 Coursera courses in the chat as well. 1443 01:13:36,120 --> 01:13:40,360 So that's definitely a resource to potentially take a look at. 1444 01:13:40,360 --> 01:13:45,360 So in the context now of what these neural networks are and how they work, 1445 01:13:45,360 --> 01:13:48,900 each of these nodes, each of these units inside of the neural network, 1446 01:13:48,900 --> 01:13:52,500 is usually calculating some function based on the inputs, based 1447 01:13:52,500 --> 01:13:54,315 on the values that are coming into it. 1448 01:13:54,315 --> 01:13:56,190 And there are a number of different functions 1449 01:13:56,190 --> 01:13:57,990 that I might use, for example. 1450 01:13:57,990 --> 01:13:59,970 Some will use a steep thresholds. 1451 01:13:59,970 --> 01:14:03,720 So we talk about what it means for there to be this hard threshold function. 1452 01:14:03,720 --> 01:14:06,180 Some will usually use a softer threshold function 1453 01:14:06,180 --> 01:14:09,170 that has a bit of a nicer curve to it for example. 1454 01:14:09,170 --> 01:14:11,640 But by combining these units together, you 1455 01:14:11,640 --> 01:14:15,870 can start to create neural networks that accept some data as input, 1456 01:14:15,870 --> 01:14:18,090 and are able to predict some data as output. 1457 01:14:18,090 --> 01:14:20,250 And effectively, what the neural network does, 1458 01:14:20,250 --> 01:14:22,360 is the neural network is a big function. 1459 01:14:22,360 --> 01:14:27,030 The function is just taking numbers as input, generating numbers as output. 1460 01:14:27,030 --> 01:14:29,370 And the question is, what does that function do? 1461 01:14:29,370 --> 01:14:32,820 How does the function work to translate the input to the output? 1462 01:14:32,820 --> 01:14:35,550 And the neural networks are designed in such a way that 1463 01:14:35,550 --> 01:14:38,910 using an algorithm, known as the backpropagation algorithm, 1464 01:14:38,910 --> 01:14:43,170 we can train the algorithm, we can train the individual units 1465 01:14:43,170 --> 01:14:46,630 inside this neural network to learn what the right function is. 1466 01:14:46,630 --> 01:14:49,500 So even if you don't know what the function is to go from the inputs 1467 01:14:49,500 --> 01:14:52,020 to the outputs, you can train a neural network 1468 01:14:52,020 --> 01:14:54,700 to be able to figure that out for itself. 1469 01:14:54,700 --> 01:14:56,760 And people have been able to use this technique 1470 01:14:56,760 --> 01:14:59,100 to do incredibly powerful things, especially when 1471 01:14:59,100 --> 01:15:03,300 it comes to multi-layer neural networks that aren't just input and output. 1472 01:15:03,300 --> 01:15:07,860 But inputs that go to some intermediary layer, and maybe even more layers 1473 01:15:07,860 --> 01:15:08,800 after that. 1474 01:15:08,800 --> 01:15:10,530 And then to some kind of output. 1475 01:15:10,530 --> 01:15:13,530 And these multilayered networks are able to solve some amazing problems, 1476 01:15:13,530 --> 01:15:17,760 and I'll show you an example of that in just a moment. 1477 01:15:17,760 --> 01:15:20,220 And there are several different types of neural networks, 1478 01:15:20,220 --> 01:15:22,887 different architectures, as they're called, for neural networks, 1479 01:15:22,887 --> 01:15:25,092 for solving different sorts of problems. 1480 01:15:25,092 --> 01:15:28,050 One of the common problems we want to use neural networks to solve them 1481 01:15:28,050 --> 01:15:29,880 is something like computer vision. 1482 01:15:29,880 --> 01:15:32,250 Being able to, for example recognize handwriting. 1483 01:15:32,250 --> 01:15:35,580 If I handwrite the number two or I handwrite the number eight, 1484 01:15:35,580 --> 01:15:39,660 can you look at that handwritten information and figure out is it a two 1485 01:15:39,660 --> 01:15:40,493 or is that an eight? 1486 01:15:40,493 --> 01:15:42,868 If you were to write this from scratch, it would probably 1487 01:15:42,868 --> 01:15:44,010 be quite difficult to do. 1488 01:15:44,010 --> 01:15:46,900 Because everyone writes their numbers a little bit differently. 1489 01:15:46,900 --> 01:15:50,340 How exactly would you construct the if statements, or the loops, 1490 01:15:50,340 --> 01:15:54,240 for example, to be able to figure out exactly what number it is. 1491 01:15:54,240 --> 01:15:58,650 It would be challenging to write code manually to do this. 1492 01:15:58,650 --> 01:16:01,560 But our neural network can solve this problem pretty readily. 1493 01:16:01,560 --> 01:16:04,260 In fact, there's a particular type of neural network called 1494 01:16:04,260 --> 01:16:07,380 a convolutional neural network that takes the image, 1495 01:16:07,380 --> 01:16:10,350 tries to reduce it down to just the relevant features, 1496 01:16:10,350 --> 01:16:14,580 and then perform some calculations to then try to figure out 1497 01:16:14,580 --> 01:16:19,422 what digit is it, or try to do some kind of processing on that particular image. 1498 01:16:19,422 --> 01:16:21,630 And there are other types of neural networks as well. 1499 01:16:21,630 --> 01:16:24,990 Recurrent neural networks when dealing with longer sequences of inputs 1500 01:16:24,990 --> 01:16:25,980 and outputs. 1501 01:16:25,980 --> 01:16:29,292 This is especially useful for things like machine translation, where 1502 01:16:29,292 --> 01:16:31,500 you're trying to translate one language into another. 1503 01:16:31,500 --> 01:16:35,030 It can be quite helpful for doing that sort of thing, too. 1504 01:16:35,030 --> 01:16:39,970 So lots of different applications for neural networks as well. 1505 01:16:39,970 --> 01:16:42,210 And just for fun, I thought I'd show you perhaps one 1506 01:16:42,210 --> 01:16:46,200 of the coolest applications, in my opinion, of neural networks. 1507 01:16:46,200 --> 01:16:48,653 I'm going to show you two images. 1508 01:16:48,653 --> 01:16:50,570 Image one on the left, image two on the right. 1509 01:16:50,570 --> 01:16:52,150 And I'm going to ask you a question. 1510 01:16:52,150 --> 01:16:56,700 Can you predict which of these two images was computer generated? 1511 01:16:56,700 --> 01:16:59,130 That is to say, generated by a computer as such 1512 01:16:59,130 --> 01:17:03,360 that it's not a real photo of a person, but actually 1513 01:17:03,360 --> 01:17:05,600 it's just entirely computer generated. 1514 01:17:05,600 --> 01:17:07,930 And if you'd like to answer on the poll there. 1515 01:17:07,930 --> 01:17:10,017 I'd be curious to hear people's answers. 1516 01:17:10,017 --> 01:17:11,850 All right, we'll take a look at the results. 1517 01:17:11,850 --> 01:17:15,910 1518 01:17:15,910 --> 01:17:18,055 Looks like slightly more than half of people 1519 01:17:18,055 --> 01:17:20,430 now think-- or actually, it's alternating back and forth, 1520 01:17:20,430 --> 01:17:21,610 it's pretty even. 1521 01:17:21,610 --> 01:17:26,797 Totally OK if it's pretty even, because Joe and Tristy are correct, 1522 01:17:26,797 --> 01:17:28,630 both of these images are computer generated. 1523 01:17:28,630 --> 01:17:31,150 Neither of these is a photo of a real person. 1524 01:17:31,150 --> 01:17:34,870 Both of these are just generated by what's 1525 01:17:34,870 --> 01:17:36,880 known as a generative adversarial network, 1526 01:17:36,880 --> 01:17:38,830 just a neural network that has been trained 1527 01:17:38,830 --> 01:17:42,820 to generate photos that look photo realistic, look like real people, 1528 01:17:42,820 --> 01:17:44,540 but actually are not. 1529 01:17:44,540 --> 01:17:47,740 And yes, Andrew has pasted a link to thispersondoesnotexist, 1530 01:17:47,740 --> 01:17:51,708 which is an implementation of such an idea that you can go to that page 1531 01:17:51,708 --> 01:17:53,000 and refresh it again and again. 1532 01:17:53,000 --> 01:17:54,875 And every time you go to that website, you're 1533 01:17:54,875 --> 01:17:58,850 going to get a different photo of a person that does not exist. 1534 01:17:58,850 --> 01:18:02,577 And so incredibly powerful tools that neural networks-- 1535 01:18:02,577 --> 01:18:05,410 problems that neural networks can solve and things that they can do, 1536 01:18:05,410 --> 01:18:06,890 which are quite interesting. 1537 01:18:06,890 --> 01:18:11,138 So we introduce students to how to do some of this type of work, 1538 01:18:11,138 --> 01:18:13,180 how to write and create a neural network in order 1539 01:18:13,180 --> 01:18:15,070 to solve certain types of problems. 1540 01:18:15,070 --> 01:18:17,950 In particular, we introduce students to TensorFlow, 1541 01:18:17,950 --> 01:18:21,700 which is a popular library framework for solving machine learning 1542 01:18:21,700 --> 01:18:23,030 sort of problems. 1543 01:18:23,030 --> 01:18:28,100 And we use this in particular for the project that students work on, 1544 01:18:28,100 --> 01:18:30,460 which is this traffic problem here, where 1545 01:18:30,460 --> 01:18:33,880 we ask students to think about how self-driving cars might work. 1546 01:18:33,880 --> 01:18:38,290 And one part of a self-driving car is going to be looking at photos 1547 01:18:38,290 --> 01:18:40,840 and identifying what road signs are in those photos. 1548 01:18:40,840 --> 01:18:43,870 Figuring out, is that a do not enter sign, is it a stop sign, 1549 01:18:43,870 --> 01:18:47,230 is it a speed limit, if so, what is the speed limit? 1550 01:18:47,230 --> 01:18:49,900 And this is a problem that AI researchers have to deal with. 1551 01:18:49,900 --> 01:18:51,980 There was an article a couple months ago, 1552 01:18:51,980 --> 01:18:56,950 if someone can find it, of someone who is able to fool the Tesla computer 1553 01:18:56,950 --> 01:19:01,060 vision algorithm into thinking the speed limit was some different speed limit 1554 01:19:01,060 --> 01:19:01,940 sign, for example. 1555 01:19:01,940 --> 01:19:04,690 And so this is an active area of research, where people are really 1556 01:19:04,690 --> 01:19:07,270 trying to figure out how do you train neural networks to be 1557 01:19:07,270 --> 01:19:10,780 able to look at photos of street signs and figure out 1558 01:19:10,780 --> 01:19:12,290 what those signs actually are. 1559 01:19:12,290 --> 01:19:15,530 And so we asked students, using TensorFlow, to build a neural network. 1560 01:19:15,530 --> 01:19:18,580 We give them a whole bunch of data of existing street signs, 1561 01:19:18,580 --> 01:19:23,140 and try to have them build some classifier that can take some images 1562 01:19:23,140 --> 01:19:27,550 and then try to predict which of those images 1563 01:19:27,550 --> 01:19:30,740 are which particular street signs as well. 1564 01:19:30,740 --> 01:19:34,918 Ramon, I see your hand is raised. 1565 01:19:34,918 --> 01:19:40,880 RAMON: My question is, are all of these topics fundamentals for AI? 1566 01:19:40,880 --> 01:19:44,930 Or are there some topics that are more advanced 1567 01:19:44,930 --> 01:19:50,950 and really, really specific for a certain field in AI? 1568 01:19:50,950 --> 01:19:55,450 And if that's the case, why did you choose these as the basic topic 1569 01:19:55,450 --> 01:19:59,500 topics instead of any other ones? 1570 01:19:59,500 --> 01:20:02,810 BRIAN YEW: Yeah, so AI encompasses a wide variety of different techniques 1571 01:20:02,810 --> 01:20:05,240 and strategies and approaches. 1572 01:20:05,240 --> 01:20:09,890 And they're not all necessarily related to each other. 1573 01:20:09,890 --> 01:20:12,320 Oftentimes they're inspired by similar ideas 1574 01:20:12,320 --> 01:20:15,098 or may use some similar principles or algorithms. 1575 01:20:15,098 --> 01:20:16,890 But there are a lot of different algorithms 1576 01:20:16,890 --> 01:20:21,320 that might be falling under the broader category of artificial intelligence. 1577 01:20:21,320 --> 01:20:23,690 So ultimately, there were a lot of topics 1578 01:20:23,690 --> 01:20:27,590 that I could have or thought about talking about in this course that 1579 01:20:27,590 --> 01:20:30,470 ultimately didn't make it, simply because we had to pick and choose 1580 01:20:30,470 --> 01:20:33,560 what was the right curriculum for just this introductory class. 1581 01:20:33,560 --> 01:20:38,060 In terms of the material that I chose, it was informed by two main factors. 1582 01:20:38,060 --> 01:20:42,260 One, in particular, was a what is going to be 1583 01:20:42,260 --> 01:20:46,550 the most general purpose and relevant tools for solving 1584 01:20:46,550 --> 01:20:47,842 a wide variety of problems? 1585 01:20:47,842 --> 01:20:49,550 There are a lot of AI algorithms that are 1586 01:20:49,550 --> 01:20:52,550 very specific to one type of problem, and I 1587 01:20:52,550 --> 01:20:55,388 tried to focus more on broader AI algorithms that can be 1588 01:20:55,388 --> 01:20:56,930 used for a lot of different problems. 1589 01:20:56,930 --> 01:21:01,280 For solving clustering problems in general, or for solving classification 1590 01:21:01,280 --> 01:21:04,820 problems in general, or for performing search algorithms in general, 1591 01:21:04,820 --> 01:21:05,630 for instance. 1592 01:21:05,630 --> 01:21:07,600 So that was the first component. 1593 01:21:07,600 --> 01:21:10,610 The second component was trying to identify which topics would 1594 01:21:10,610 --> 01:21:12,797 be most mathematically accessible. 1595 01:21:12,797 --> 01:21:15,380 There are some topics like neural networks that, on their own, 1596 01:21:15,380 --> 01:21:17,720 are not mathematically accessible, that I still thought were worth 1597 01:21:17,720 --> 01:21:18,680 talking about. 1598 01:21:18,680 --> 01:21:20,930 So the course tries to introduce those in a more 1599 01:21:20,930 --> 01:21:23,180 mathematically accessible way. 1600 01:21:23,180 --> 01:21:26,210 But there are other topics where we tried 1601 01:21:26,210 --> 01:21:29,990 to choose algorithms that would be most intuitive for someone who had never 1602 01:21:29,990 --> 01:21:32,080 seen these sorts of algorithms before. 1603 01:21:32,080 --> 01:21:34,130 That they could then learn more about if that was 1604 01:21:34,130 --> 01:21:37,420 something that was interesting to them. 1605 01:21:37,420 --> 01:21:39,928 In terms of the connection to biology, that's 1606 01:21:39,928 --> 01:21:42,970 actually one thing that we try to talk about a lot throughout the course. 1607 01:21:42,970 --> 01:21:49,360 And one thing you'll find is that a lot of the ways that we approach algorithms 1608 01:21:49,360 --> 01:21:52,120 is similar to thinking about the ways that humans might learn. 1609 01:21:52,120 --> 01:21:54,310 In particular, when it comes to machine learning. 1610 01:21:54,310 --> 01:21:56,310 That with something like reinforcement learning, 1611 01:21:56,310 --> 01:21:58,390 for example, it's learning through experience. 1612 01:21:58,390 --> 01:21:59,680 It's learning through reward. 1613 01:21:59,680 --> 01:22:01,390 When you do something well, you get a reward, 1614 01:22:01,390 --> 01:22:03,100 you learn to do that more in the future. 1615 01:22:03,100 --> 01:22:06,350 You get some punishment, you learn not to do that kind of thing in the future. 1616 01:22:06,350 --> 01:22:09,640 It's the way that some humans might learn, especially children. 1617 01:22:09,640 --> 01:22:12,040 And we can apply the exact same techniques 1618 01:22:12,040 --> 01:22:15,700 to work with computers as well. 1619 01:22:15,700 --> 01:22:18,850 And there are even other types of algorithms like genetic algorithms 1620 01:22:18,850 --> 01:22:22,270 that are used in evolution and reproduction based model 1621 01:22:22,270 --> 01:22:26,680 to try and grow artificial intelligence into more and more intelligent systems. 1622 01:22:26,680 --> 01:22:30,170 And that too, very much inspired by the world of biology. 1623 01:22:30,170 --> 01:22:36,080 So there's a lot of connections between biology and artificial intelligence. 1624 01:22:36,080 --> 01:22:37,265 Ramon, go ahead. 1625 01:22:37,265 --> 01:22:41,320 RAMON: Yeah, my question is, which of these topics 1626 01:22:41,320 --> 01:22:45,350 do you feel more excited to teach, and which of the topics 1627 01:22:45,350 --> 01:22:48,470 did you feel more challenged to deliver to students? 1628 01:22:48,470 --> 01:22:51,980 And my second question out that way, now that you 1629 01:22:51,980 --> 01:23:02,690 have talked about all of the topics is the mantra or the principle for AI 1630 01:23:02,690 --> 01:23:08,360 to do things like logically or in a humanly way, 1631 01:23:08,360 --> 01:23:12,630 like you said at the beginning of the session. 1632 01:23:12,630 --> 01:23:16,760 BRIAN YEW: Yeah, so I think it's hard to come up 1633 01:23:16,760 --> 01:23:20,180 with a topic in this list of topics that I wasn't excited to teach. 1634 01:23:20,180 --> 01:23:23,390 Because I came up with-- when I was first brainstorming for this class, 1635 01:23:23,390 --> 01:23:26,480 there was a very long list of topics that I could have talked about. 1636 01:23:26,480 --> 01:23:29,388 And I very consciously narrowed it down to just the ones 1637 01:23:29,388 --> 01:23:32,180 that I thought would be most interesting and exciting for students, 1638 01:23:32,180 --> 01:23:34,775 most relevant for them, most accessible. 1639 01:23:34,775 --> 01:23:36,650 And so really, all of these topics are things 1640 01:23:36,650 --> 01:23:40,527 that I have a lot of very personal interest in. 1641 01:23:40,527 --> 01:23:42,860 The last topic, which we're about to get to in a moment, 1642 01:23:42,860 --> 01:23:46,520 in particular, language, in college, I studied linguistics. 1643 01:23:46,520 --> 01:23:48,980 And so studying language and natural language processing 1644 01:23:48,980 --> 01:23:51,520 is a very much an interest of mine, and something 1645 01:23:51,520 --> 01:23:54,830 that I thought about for sure. 1646 01:23:54,830 --> 01:23:58,190 Ethics are something that are not in any of the lectures themselves. 1647 01:23:58,190 --> 01:24:00,590 But I do think AI ethics are incredibly important. 1648 01:24:00,590 --> 01:24:03,440 Harvard has had a longstanding program called embedded ethics 1649 01:24:03,440 --> 01:24:07,040 for trying to include ethical discussions in their computer science 1650 01:24:07,040 --> 01:24:08,220 classes. 1651 01:24:08,220 --> 01:24:11,140 And so certainly, if you end up teaching the material, 1652 01:24:11,140 --> 01:24:13,070 I'd encourage and discussion sections to be 1653 01:24:13,070 --> 01:24:14,730 able to talk about the sort of thing. 1654 01:24:14,730 --> 01:24:18,020 And I think that these are the sorts of conversations that are really good 1655 01:24:18,020 --> 01:24:20,420 not to have someone lecturing at you for, 1656 01:24:20,420 --> 01:24:24,740 but for students to be really thinking about, brainstorming ideas, even 1657 01:24:24,740 --> 01:24:27,980 writing about it, to be able to talk about these topics as well, 1658 01:24:27,980 --> 01:24:31,290 to be able to think about the implications of these decisions, 1659 01:24:31,290 --> 01:24:32,060 especially lately. 1660 01:24:32,060 --> 01:24:35,660 Things like facial recognition which computer vision is becoming good at, 1661 01:24:35,660 --> 01:24:38,930 are things that have come under criticism for in the United States, 1662 01:24:38,930 --> 01:24:41,120 in particular, but also elsewhere. 1663 01:24:41,120 --> 01:24:44,630 So definitely topics that are absolutely worth thinking about and considering 1664 01:24:44,630 --> 01:24:46,520 and discussing as well. 1665 01:24:46,520 --> 01:24:47,360 Is there a way-- 1666 01:24:47,360 --> 01:24:48,410 I see Joe's question. 1667 01:24:48,410 --> 01:24:51,620 Is there a way to distinguish between where brute force programming stops 1668 01:24:51,620 --> 01:24:54,800 and where AI starts? 1669 01:24:54,800 --> 01:24:59,120 Oftentimes, AI will look to take brute force algorithms 1670 01:24:59,120 --> 01:25:03,300 and try to make improvements upon them. 1671 01:25:03,300 --> 01:25:06,500 So you might take a brute force algorithm like Minimax. 1672 01:25:06,500 --> 01:25:09,770 And Minimax, you might still consider artificial intelligence, 1673 01:25:09,770 --> 01:25:12,650 because it's able to do something intelligently 1674 01:25:12,650 --> 01:25:14,760 or rationally, for example. 1675 01:25:14,760 --> 01:25:17,420 So that you can solve a problem that you otherwise 1676 01:25:17,420 --> 01:25:19,900 would have had a more difficult time trying to solve. 1677 01:25:19,900 --> 01:25:23,530 1678 01:25:23,530 --> 01:25:26,140 But what we tried to do in order to solve more complex games, 1679 01:25:26,140 --> 01:25:28,030 games like chess or games like go, where it 1680 01:25:28,030 --> 01:25:29,863 would be totally unreasonable for a computer 1681 01:25:29,863 --> 01:25:32,920 to brute force its way through the entirety of the game, 1682 01:25:32,920 --> 01:25:36,940 is to instead try to optimize them in some way. 1683 01:25:36,940 --> 01:25:41,170 Use heuristics, and try to figure out what data you can eliminate. 1684 01:25:41,170 --> 01:25:44,980 And these sorts of techniques are really where I think the heart of AI 1685 01:25:44,980 --> 01:25:45,790 starts to come in. 1686 01:25:45,790 --> 01:25:49,420 This idea of trying to use those heuristics to predict 1687 01:25:49,420 --> 01:25:51,520 what is going to be relevant and not relevant, 1688 01:25:51,520 --> 01:25:54,370 and how to avoid having to do all of the brute force 1689 01:25:54,370 --> 01:25:57,510 work to be able to solve the problem. 1690 01:25:57,510 --> 01:26:01,030 Ramon, sorry I didn't get to all of your questions. 1691 01:26:01,030 --> 01:26:03,188 But what was the most challenging topic to teach? 1692 01:26:03,188 --> 01:26:05,230 I think the most challenging topic to lesson plan 1693 01:26:05,230 --> 01:26:07,660 for were the machine learning topics. 1694 01:26:07,660 --> 01:26:13,450 All of them, machine learning and neural networks, just because most of the way 1695 01:26:13,450 --> 01:26:17,170 this is usually taught involves a lot of mathematics. 1696 01:26:17,170 --> 01:26:22,480 And it required several revisions to get through this material in such a way 1697 01:26:22,480 --> 01:26:25,090 that it would be beginner friendly. 1698 01:26:25,090 --> 01:26:30,140 And so that was probably one of the most challenging things. 1699 01:26:30,140 --> 01:26:33,140 Thank you, Angela, for sharing that article about facial recognition. 1700 01:26:33,140 --> 01:26:36,113 Definitely thinking about uses for facial recognition, 1701 01:26:36,113 --> 01:26:38,030 when and where it should be used, is something 1702 01:26:38,030 --> 01:26:39,350 that needs to be thought about. 1703 01:26:39,350 --> 01:26:43,080 And there are signs that technology companies are beginning 1704 01:26:43,080 --> 01:26:45,080 to think about that as well, and beginning 1705 01:26:45,080 --> 01:26:49,970 to release decisions over the course of recent weeks over that too. 1706 01:26:49,970 --> 01:26:54,870 All right, I'll go ahead and talk about the last topic here too. 1707 01:26:54,870 --> 01:26:57,930 And so the final topic that's covered in the course is about language. 1708 01:26:57,930 --> 01:27:01,940 And it's all about how is it that artificial intelligence can begin 1709 01:27:01,940 --> 01:27:06,470 to speak and understand the language of humans, to understand our language 1710 01:27:06,470 --> 01:27:09,150 and how it is that we communicate. 1711 01:27:09,150 --> 01:27:12,260 So we start by taking a look at syntax, the structure of language, 1712 01:27:12,260 --> 01:27:16,700 beginning to build an understanding for how AI can take a sentence 1713 01:27:16,700 --> 01:27:19,970 and identify what the different components 1714 01:27:19,970 --> 01:27:23,120 and what the different parts of that sentence are, for example. 1715 01:27:23,120 --> 01:27:27,650 And then we look at other ways that AI can analyze language, as well. 1716 01:27:27,650 --> 01:27:31,820 N-gram models that are a model where you look at sequences of words or sequences 1717 01:27:31,820 --> 01:27:35,537 of characters at a time to be able to perform analysis. 1718 01:27:35,537 --> 01:27:38,120 And that's useful, because it's often difficult for a computer 1719 01:27:38,120 --> 01:27:43,200 to take an entire paragraph or an entire essay and analyze all of that at once. 1720 01:27:43,200 --> 01:27:46,370 But it's easier to break it down into smaller discrete chunks 1721 01:27:46,370 --> 01:27:50,000 and analyze those chunks individually, too. 1722 01:27:50,000 --> 01:27:53,850 We might want to do classification with natural language as well. 1723 01:27:53,850 --> 01:27:56,270 So we introduced the Naive Bayes algorithm, 1724 01:27:56,270 --> 01:27:59,060 which does something like assess the sentiment of a sentence. 1725 01:27:59,060 --> 01:28:03,020 Can you tell whether a sentiment-- whether a message is positive 1726 01:28:03,020 --> 01:28:05,610 or whether it's negative, for example. 1727 01:28:05,610 --> 01:28:09,553 And so these are the sorts of questions that you might want answered. 1728 01:28:09,553 --> 01:28:11,720 And you might need to do with some language analysis 1729 01:28:11,720 --> 01:28:15,370 to be able to answer those questions. 1730 01:28:15,370 --> 01:28:17,630 We talk as well about information retrieval, 1731 01:28:17,630 --> 01:28:20,930 like how do you identify information inside of documents. 1732 01:28:20,930 --> 01:28:24,110 And then later, how do you extract that information out of documents? 1733 01:28:24,110 --> 01:28:26,780 If you're trying to answer questions for example. 1734 01:28:26,780 --> 01:28:31,680 So we talk about methods that can be used for doing that, too. 1735 01:28:31,680 --> 01:28:34,360 And then finally, to wrap up, we introduce 1736 01:28:34,360 --> 01:28:38,380 a system that uses neural networks to be able to analyze language as well. 1737 01:28:38,380 --> 01:28:43,450 Trying to put language and take words and put them into a numerical form 1738 01:28:43,450 --> 01:28:47,403 that computers are going to be able to understand as well. 1739 01:28:47,403 --> 01:28:49,320 In terms of the projects the students work on, 1740 01:28:49,320 --> 01:28:53,040 they work on one project that's meant to parse sentences, identify 1741 01:28:53,040 --> 01:28:56,070 the various different component parts of the sentences. 1742 01:28:56,070 --> 01:28:59,760 And then finally, the last project is to write a question and answer system. 1743 01:28:59,760 --> 01:29:02,010 They write a program where you can type in a question, 1744 01:29:02,010 --> 01:29:04,380 like what are the types of supervised learning, 1745 01:29:04,380 --> 01:29:07,470 and the AI is supposed to reply with an answer. 1746 01:29:07,470 --> 01:29:10,500 And it does so by looking through a corpus of existing knowledge, 1747 01:29:10,500 --> 01:29:13,192 trying to identify what the relevant pieces of knowledge are, 1748 01:29:13,192 --> 01:29:15,900 trying to understand what it is the question is asking, like what 1749 01:29:15,900 --> 01:29:17,970 are the important words in this question, 1750 01:29:17,970 --> 01:29:20,640 and then trying to come up with what is the best answer that I 1751 01:29:20,640 --> 01:29:23,730 can give to that particular question. 1752 01:29:23,730 --> 01:29:29,120 Naive Bayes is the name of the algorithm for doing 1753 01:29:29,120 --> 01:29:31,100 this kind of sentiment analysis. 1754 01:29:31,100 --> 01:29:34,160 It's one possible way of doing this sort of idea 1755 01:29:34,160 --> 01:29:36,590 where you're looking at individual words and trying 1756 01:29:36,590 --> 01:29:41,210 to predict whether those words are going to mean it belongs to one category 1757 01:29:41,210 --> 01:29:44,090 or belong to some other category. 1758 01:29:44,090 --> 01:29:49,950 And so that then is what it is that we cover in this artificial intelligence 1759 01:29:49,950 --> 01:29:50,970 course. 1760 01:29:50,970 --> 01:29:53,790 So we start with search, we talk about knowledge, 1761 01:29:53,790 --> 01:29:57,210 we talk about uncertainty, we talk about optimization 1762 01:29:57,210 --> 01:29:59,640 and how to try and find the best solutions to problems. 1763 01:29:59,640 --> 01:30:02,400 Then we turn to machine learning, trying to categorize data, 1764 01:30:02,400 --> 01:30:05,130 using neural networks to try to solve problems. 1765 01:30:05,130 --> 01:30:09,120 And then trying to write AI that can understand and deal 1766 01:30:09,120 --> 01:30:11,250 with natural language as well. 1767 01:30:11,250 --> 01:30:15,930 That wraps up our final session for the CS50x educator workshop. 1768 01:30:15,930 --> 01:30:17,165 So thank you all very much. 1769 01:30:17,165 --> 01:30:20,040 It was great to have you here and looking forward to keeping in touch 1770 01:30:20,040 --> 01:30:22,430 and talking more in the future. 1771 01:30:22,430 --> 01:30:23,000