Stanford CS229: Machine Learning Course, Lecture 1 - Andrew Ng (Autumn 2018)

Stanford Online
17 Apr 202075:20

Summary

TLDR这是斯坦福大学著名的CS229机器学习课程的开场演讲,由Andrew Ng教授主讲。他介绍了机器学习的重要性和影响力,并概述了课程内容,包括监督学习、无监督学习、深度学习和强化学习等。Ng教授强调了机器学习在各行各业的应用潜力,并鼓励学生们通过这门课程掌握机器学习的技能,以便在未来能够对社会产生积极的影响。

Takeaways

  • 📘 机器学习课程CS229在斯坦福有着悠久的历史,培养了众多专业人才,并影响了众多产品、服务和创业公司。
  • 🌟 人工智能(AI)被比喻为新的电力,预示着各行各业的变革,机器学习和深度学习将改变世界。
  • 📈 机器学习的应用范围不断扩大,不仅在科技公司,在制造业、医疗、物流等行业也有广泛的应用。
  • 🎓 CS229课程旨在让学生在10周后成为机器学习领域的专家,并能够构建有意义的机器学习应用。
  • 🛠️ 课程的教学团队由安德鲁·吴(Andrew Ng)教授和多位具有不同专业背景的助教组成,他们将为学生提供专业的指导和帮助。
  • 🔄 机器学习的核心领域包括监督学习、无监督学习、深度学习和强化学习,CS229课程将涵盖这些主题。
  • 🤖 强化学习是一种让机器通过试错来学习的方法,类似于训练宠物,通过奖励和惩罚来优化行为。
  • 📊 监督学习是机器学习中最常用的工具,通过给定的输入X和标签Y来学习映射关系,用于解决回归和分类问题。
  • 🤔 学习策略(Learning Theory)是教授如何有效应用学习算法的学科,旨在使机器学习成为一种系统化的工程学科。
  • 📚 课程鼓励学生积极参与在线讨论平台Piazza,提出问题并帮助他人解答,以此促进学习交流。

Q & A

  • CS229课程在斯坦福大学有着怎样的历史和影响?

    -CS229课程在斯坦福大学有着悠久的历史,长期以来一直是教授最为期待教授的课程之一。这门课程帮助了许多斯坦福学生成为机器学习领域的专家,并继续建立许多产品和服务、创业公司,这些可能正是在座的各位正在使用或将会使用的。

  • AI如何被比喻,它对世界的影响有哪些?

    -AI被比喻为新的电力,就像大约100年前电力的出现一样,它改变了每一个主要行业。AI,特别是机器学习和深度学习,将改变世界。通过CS229课程,学生将获得必要的工具,成为未来行业巨头之一,无论是帮助大型科技公司做出惊人的成就,还是建立自己的创业公司,或者进入其他行业如医疗保健、交通等,做出有意义的变革。

  • 机器学习技能的需求现状如何?

    -机器学习技能的需求非常巨大。原因在于机器学习在过去几年中发展迅速,为学习算法提供了许多应用机会,无论是在工业界还是学术界。从英语系教授尝试应用学习算法来更好地理解历史,到律师尝试将机器学习应用于处理法律文件,再到各种公司,包括非科技公司,如制造、医疗保健、物流公司等,都在尝试应用机器学习。

  • CS229课程的教学团队有哪些成员?

    -CS229课程的教学团队包括主讲教授Andrew Ng,课程协调员以及几位共同担任助教的博士生。这些助教具有丰富的技术经验,涵盖从计算机视觉、自然语言处理到计算生物学、机器人技术等不同领域。

  • CS229课程的学习目标是什么?

    -CS229课程的学习目标是让学生们在10周后成为机器学习的专家。希望学生们能够在学术环境中应用机器学习解决问题,或者在毕业后的工作中应用这些知识。此外,如果学生的主要目标是进行机器学习研究,本课程还将帮助他们能够阅读和理解研究论文,并推动该领域的最新进展。

  • CS229课程的荣誉守则有哪些规定?

    -CS229课程鼓励学生组成学习小组,讨论作业问题。但是,学生需要独立完成作业问题,讨论后需要自己写出解决方案,不能参考与朋友共同开发的笔记。课程的荣誉守则详细规定在课程网站上的数字手册中。

  • CS229课程的编程作业将使用哪种编程语言?

    -CS229课程的编程作业将从以往的MATLAB和Octave转变为使用Python,特别是NumPy库。这是因为机器学习领域正在从MATLAB和Octave的世界逐渐转向Python,最终可能会使用Java或C++等语言进行生产环境的部署。

  • CS229课程的项目有哪些特点?

    -CS229课程的项目是课程中最棒的部分之一。学生将通过小组合作完成一个有意义的机器学习项目。项目可以是选择一个领域或应用,并应用机器学习技术尝试构建一个好的机器学习系统。以往的项目涵盖了从癌症诊断到艺术创作等各种应用领域。

  • CS229课程的讨论部分有哪些内容?

    -CS229课程的讨论部分主要由助教在星期五进行,内容涵盖预备知识如线性代数、概率统计以及Python和NumPy的教学。在课程后期,讨论部分将涉及更高级的可选内容,如凸优化、隐马尔可夫模型和时间序列等。

  • CS229课程的评分标准是怎样的?

    -CS229课程的项目组最多可以有三个人。如果项目组是一个人、两个人或三个人,评分标准是一样的。但如果项目组超过三个人,评分时会使用更严格的标准。

  • CS229课程对于新入学的学生有哪些建议?

    -对于新入学的学生,CS229课程建议他们在课后与同学交流,自我介绍并建立友谊。同时,鼓励他们积极参与在线讨论版Piazza,回答问题,以及利用课程提供的资源和数字工具。

Outlines

00:00

📘 课程介绍与期望

本段落介绍了CS229机器学习课程的历史和重要性,强调了斯坦福大学在培养机器学习专家方面的影响力。教授表达了对该课程的热情,并概述了课程的目标,即让学生能够利用机器学习技术去改变世界,无论是在科技巨头公司还是在其他行业中。同时,教授提到了课程的实用性和对就业市场的深远影响。

05:00

👥 教学团队介绍

在这一段落中,教授介绍了课程的教学团队,包括课程协调员、助教和教师自己。强调了助教们的技术经验和多样性,以及他们在课程中的作用,包括在项目中的指导和帮助。教授还提到了课程的目标,即让学生在10周后成为机器学习领域的专家,并能够在各种环境中应用所学知识。

10:02

📚 课程要求与变化

本段讨论了课程的先修要求,包括基本的计算机科学知识、概率论、线性代数以及编程语言Python的熟悉度。教授提到了课程的一些变化,比如从MATLAB转向Python,并强调了团队在更新课程内容方面的努力。同时,教授还提到了课程的荣誉守则,鼓励学生在学习小组中合作,但在做作业时需要独立完成。

15:03

🎯 课程项目与合作

这一部分强调了课程项目的重要性,教授鼓励学生通过小组合作完成项目,以获得实际操作机器学习项目的经验。教授提到了以往学生项目的多样性,并鼓励新学生从课程网站获取灵感,思考自己可能的项目。同时,教授也提到了项目团队的组建和规模建议。

20:05

📅 课程安排与资源

教授介绍了课程的日程安排,包括讲座、讨论课和在线资源的利用。强调了讨论课对于理解先修知识和深入理解课程内容的重要性。同时,教授提到了Piazza在线讨论板的作用,鼓励学生积极参与讨论和回答问题。此外,教授还提到了Gradescope在线评分工具的使用。

25:06

🤖 机器学习的定义与应用

在这一部分中,教授通过定义和例子阐述了机器学习的概念,包括Arthur Samuel的定义和Tom Mitchell的描述。通过棋类游戏和房价预测的例子,教授解释了监督学习的概念,并引入了回归和分类问题。此外,教授还提到了机器学习在改善世界方面的潜力,强调了技术进步带来的机遇。

30:07

📈 监督学习详解

本段深入讨论了监督学习,包括房价预测和肿瘤分类的例子。教授解释了如何从数据中学习输入到输出的映射,并提到了不同的模型选择问题。通过图解和例子,教授展示了如何使用监督学习算法来解决实际问题,并强调了在多维特征空间中应用算法的挑战。

35:09

🏥 机器学习在医疗领域的应用

教授通过乳腺癌预测的例子,进一步阐述了监督学习在医疗领域的应用。讨论了如何使用多个特征来进行分类,并提到了在实际应用中可能使用的大量特征。此外,教授还介绍了支持向量机(SVM)算法,以及如何使用核技巧来处理无限维度的特征空间。

40:13

🚗 监督学习在自动驾驶中的应用

通过一个关于自动驾驶的视频例子,教授展示了监督学习如何被用来训练神经网络进行决策。视频展示了神经网络如何通过观察人类驾驶员的行为来学习驾驶,并最终能够在没有人类干预的情况下控制车辆。教授强调了这种方法的有效性,并提到了课程中将会学到的相关技术。

45:14

📖 机器学习策略与学习方法

教授强调了机器学习策略的重要性,并将其与软件工程进行了类比。讨论了如何系统地应用机器学习算法,并提出了将机器学习从基于经验的黑魔法转变为系统工程学科的目标。教授还提到了自己正在编写的关于机器学习工程原则的书籍,并邀请学生获取免费草稿。

50:15

🧠 深度学习简介

教授简要介绍了深度学习,这是机器学习中一个发展迅速的子领域。提到了CS229课程将涵盖的深度学习基础,以及如何训练神经网络。同时指出,尽管深度学习非常重要,但课程还会涵盖其他有用的机器学习算法。

55:16

🔍 无监督学习的应用

教授解释了无监督学习的概念,即在没有标签的情况下从数据中发现有趣的模式或结构。通过K-means聚类算法的例子,教授展示了无监督学习如何识别数据中的集群。此外,还提到了无监督学习在新闻聚合、基因数据分析、社交网络分析和市场细分等领域的应用。

00:17

🎮 强化学习的介绍

教授通过让直升机自主飞行的例子,介绍了强化学习的概念。强化学习是一种学习方法,通过奖励和惩罚来训练模型,使其能够自主做出决策。教授提到了强化学习在游戏、机器人控制和物流系统优化等领域的应用,并展示了通过学习算法让机器人狗越过障碍的视频。

05:18

🤝 课程参与与互动

教授鼓励学生在课堂上相互认识,结交朋友,寻找项目合作伙伴和学习小组。同时,教授提到了Piazza平台的作用,鼓励学生在平台上提问和帮助他人回答问题,以促进课程的互动和学习。

Mindmap

Keywords

💡机器学习

机器学习是一种使计算机通过经验学习并提高性能的技术,而无需进行明确的编程。在视频中,这是课程的核心主题,教授强调了通过机器学习可以解决的问题范围很广,从预测房价到帮助自动驾驶汽车导航。

💡监督学习

监督学习是机器学习中的一种方法,它使用带有输入和对应输出标签的数据集来训练模型。在视频中,教授通过房价预测和肿瘤分类的例子来解释监督学习的概念,强调了如何通过已知数据来预测未知数据的输出。

💡无监督学习

无监督学习是机器学习的一种方法,它处理没有输出标签的数据,目的是在数据中找到隐藏的结构或模式。视频中提到了K-means聚类算法,这是一种无监督学习方法,可以用来发现数据中的集群。

💡深度学习

深度学习是机器学习的一个子领域,它使用类似于人脑的神经网络结构来学习数据的复杂模式。视频中提到,深度学习是当前发展迅速的一个领域,它在许多应用中都非常有用,比如图像识别和自然语言处理。

💡强化学习

强化学习是一种学习方法,其中算法通过与环境的交互来学习如何实现目标。它侧重于通过奖励和惩罚来优化决策过程。在视频中,教授通过训练直升机飞行和机器人狗爬越障碍的例子来解释强化学习的概念。

💡人工智能

人工智能是指使计算机系统模拟人类智能的技术,包括学习、推理和自我改进的能力。视频中提到人工智能是新的电力,意味着它将像电力一样改变每一个主要行业。

💡数据集

数据集是用于训练和测试机器学习模型的数据的集合。在视频中,数据集被用来说明如何通过监督学习和无监督学习方法来发现数据中的模式和关系。

💡算法

算法是一系列解决问题的清晰指令,机器学习算法特指用于从数据中学习和做出预测的一系列计算步骤。视频中提到了多种算法,包括用于分类和回归的算法,以及深度学习、强化学习等领域的算法。

💡特征

特征是数据集中用于描述每个实例的属性或变量。在机器学习中,特征对于算法能否成功学习和预测结果至关重要。视频中提到,实际应用中的机器学习模型通常会处理多个特征。

💡梯度下降

梯度下降是一种用于优化算法的迭代方法,它通过沿着函数梯度的最陡下降方向逐步调整参数,以最小化损失函数。在机器学习中,它常用于训练模型,如神经网络。

💡神经网络

神经网络是一种受人脑结构启发的机器学习模型,由大量互联的神经元组成,能够学习和模拟复杂的非线性关系。在视频中,神经网络被用于自动驾驶汽车的示例,说明其在处理复杂模式识别任务中的应用。

Highlights

CS229机器学习课程在斯坦福大学有着悠久的历史,培养了多代斯坦福学生成为机器学习领域的专家。

AI被比作新的电力,预示着各行各业的变革。

机器学习和AI的兴起将改变世界,CS229课程旨在为学生提供必要的工具,以便他们能够成为未来行业的领军人物。

机器学习技能的需求非常巨大,因为机器学习在过去几年中发展迅速,为学习算法的应用提供了许多机会。

CS229课程的目的是让学生在10周后成为机器学习的专家,并能够构建有意义的机器学习应用。

CS229课程不断更新,以跟上机器学习领域的快速发展。

CS229课程鼓励学生组成学习小组,以更高效地学习高度技术性的材料。

CS229课程要求学生独立完成作业,以确保作业提交反映了学生自己的工作。

CS229课程的荣誉准则明确指出,学生在讨论作业问题后,应独立撰写解决方案,不参考与朋友共同开发的笔记。

CS229课程的项目是课程的亮点之一,学生可以通过项目实践机器学习技能。

CS229课程鼓励学生在课程网站上查看往年的项目,以获得灵感并了解他们通过课程能够实现的项目类型。

CS229课程的作业和项目将使用Python编程语言,而不是以前使用的MATLAB或Octave。

CS229课程的讨论部分将涵盖预备知识,如线性代数、概率统计和Python NumPy。

CS229课程的最终项目可以由多达三人的小组完成,但如果项目组超过三人,评分标准会更严格。

CS229课程的教师团队由安德鲁·吴(Andrew Ng)领导,他曾领导Google Brain团队和百度AI团队,推动了两家公司的AI转型。

Transcripts

play00:03

Welcome to CS229 Machine Learning.

play00:06

Uh, some of you know that this class has been taught at Stanford for a long time.

play00:09

And this is often the course that, um,

play00:12

I most look forward to teaching each year because this is where we've helped I think,

play00:17

several generations of Stanford students become experts in machine learning, go on to build

play00:21

many of their products and services and startups that I'm

play00:24

sure many of you are pre- or all of you are using, uh, uh, today.

play00:28

Um, so what I want to do today was spend some time talking over, uh, logistics,

play00:35

and then, uh, spend some time, you know,

play00:37

giving you a beginning of a intro,

play00:39

talk a little bit about machine learning.

play00:41

So about 229.

play00:45

Um, you know,

play00:47

all of you have been reading about AI in the news,

play00:50

uh, about machine learning in the news.

play00:52

Um, and you probably heard me or others say, AI is the new electricity.

play00:58

Uh, the emergence and rise of electricity about 100 years ago,

play01:01

it transformed every major industry.

play01:03

I think AI already we call machine learning for the rest of the world seems to call AI.

play01:07

[NOISE]

play01:08

Um, machine learning and,

play01:11

and AI and deep learning will change the world.

play01:13

And I hope that through 229,

play01:15

we'll give you the tools you need so that you can be many of

play01:19

these future titans of industries that you can be one to go out and build,

play01:23

you know, help the large tech companies do the amazing things they do,

play01:27

or build your own start-up,

play01:28

or go into some other industry.

play01:30

Go, go transform healthcare or go

play01:31

transform transportation or go build a self-driving car.

play01:34

Um, and do all of these things that,

play01:37

um, after this class,

play01:38

I think you'll be able to do.

play01:40

You know, um, the majority of students supplying- the,

play01:45

the demand for AI skills- the demand for machine learning skills is so vast.

play01:48

I think you all know that.

play01:50

Um, and I think it's because machine learning has advanced

play01:53

so rapidly in the last few years that there are so many opportunities,

play01:57

um, to apply the learning algorithms, right?

play02:00

Both in industry as well as in academia.

play02:02

I think today, we have, um,

play02:04

the English department professors trying to

play02:06

apply learning algorithms to understand history better.

play02:08

Uh, we have lawyers trying to apply machine learning into

play02:11

process legal documents and off-campus, every company,

play02:15

both the tech companies as well as lots of

play02:17

other companies that you wouldn't consider tech companies,

play02:19

everything from manufacturing companies, to healthcare companies,

play02:22

to logistics companies are also trying to apply machine learning.

play02:26

So I think that, um, uh, uh,

play02:30

if you look at it on a- on a factual basis,

play02:33

the number of people doing

play02:35

very valuable machine learning projects today is much greater than it was six months ago.

play02:39

And six months ago is much greater than it was 12 months ago.

play02:42

And the amount of value,

play02:44

the amount of exciting meaningful work being done in machine learning is,

play02:47

is, is very strongly going up.

play02:50

Um, and I think that given the rise of, you know, the,

play02:56

the amounts of data we have as well as the new machine learning tools that we have,

play03:00

um, it will be a long time before we run out of opportunities.

play03:04

You know, before, before society as

play03:06

a whole has enough people with the machine learning skill set.

play03:09

Um, so just as maybe, I don't know,

play03:12

20 years ago was a good time to start working on this Internet thing and

play03:17

all people that started working on the Internet like 20 years ago have fantastic careers.

play03:22

I think today is a wonderful time to jump into machine learning, uh, and, and,

play03:27

and the number of- and the opportunities for you to

play03:30

do unique things that no one has- no one else is doing, right?

play03:34

The opportunity for you to go to a logistics company and

play03:36

find that exciting way to apply machine learning, uh,

play03:39

will be very high because chances are

play03:42

that logistic company has no one else even working on this.

play03:46

Because, you know, they probably can't- they,

play03:48

they may not be able to hire a fantastic Stanford student that's a graduate of CS229, right?

play03:52

Because there just aren't a lot of CS229 graduates around.

play03:54

Um, so what I want to do today is,

play03:59

um, do a quick intro talking about logistics.

play04:02

Um, and then uh, we'll,

play04:05

we'll spend the second half of the day, you know,

play04:06

giving an overview and,

play04:07

and talk a little bit more about machine learning.

play04:10

Okay? And uh- oh, and I apologize.

play04:12

I- I think that, uh, this room,

play04:14

according to that sign there, seats,

play04:16

what, 300 and something students.

play04:18

Uh, I think- we have, uh,

play04:20

uh, like not quite 800 people enrolled in this class.

play04:24

[LAUGHTER] Uh, so there are people outside, and,

play04:27

and all of the classes,

play04:28

uh, are recorded and broadcast in SCPD.

play04:31

Uh, they usually- the videos are usually made available the same day.

play04:34

So for those who they can't get into the room, my apologies.

play04:38

Um, the- there were some years, um,

play04:40

where even I had trouble getting into the room but I'm glad [LAUGHTER] they let me in.

play04:44

But, but I'm- but, but hopefully, you can watch.

play04:47

You, you can watch all of these things online shortly.

play04:49

[inaudible].

play04:51

Oh, I see. Yes. Yeah. [LAUGHTER] I don't know,

play04:54

it's a bit complicated.

play04:55

[LAUGHTER] Yeah. Thank you.

play04:57

I think it's okay. Yeah. I- I- okay, yeah.

play05:00

Yeah. Maybe for the next few classes you can squeeze in and use the NTC.

play05:04

So for now, it might be too complicated.

play05:07

Okay. So quick intros, um,

play05:10

uh, I'm sorry, I should have introduced myself. My name is Andrew Ng.

play05:13

[LAUGHTER] Uh, uh, uh, and I wanted to introduce

play05:17

some of the rest of the teaching team as well.

play05:21

There's a class coordinator.

play05:24

Um, she has been playing this role for many years now and helps

play05:28

keep the trains run on time and make sure that everything in

play05:30

class happens when it's supposed to.

play05:33

Uh, uh, so, so, so should be uh- and then, uh,

play05:36

we're thrilled to have-

play05:39

Do you guys want to stand up?

play05:40

Uh, we have the co-head TAs,

play05:42

uh, respectively are PhD students working with me.

play05:46

Uh, and so bringing a lot of, um, uh,

play05:50

technical experience, uh, technical experience in

play05:53

machine learning as well as practical know-how on how to actually make these things work.

play05:57

And with the large class that we have,

play06:00

we have a large TA team.

play06:01

Um, maybe I won't introduce all of the TAs here today

play06:04

but you'll meet many of them throughout this course here.

play06:06

But the TAs expertise span everything from computer vision and natural language processing,

play06:10

to computational biology, to robotics.

play06:13

And so, um, through this quarter,

play06:15

as you work on your class projects,

play06:17

I hope that you get a lot of, uh,

play06:19

help and advice and mentoring from the TAs, uh,

play06:21

all of which- all of whom have deep expertise not just in

play06:24

machine learning but often in a specific vertical application area,

play06:28

um, of machine learning.

play06:29

So depending on what your projects,

play06:31

we tried to match you to a TA that can give you advice, um, eh,

play06:34

the most relevant, uh,

play06:36

whatever project you end up working on.

play06:39

Um, so yeah, goal of this class,

play06:42

I hope that after the next 10 weeks,

play06:45

uh, you will be an expert in machine learning.

play06:48

Um, it turns out that, uh,

play06:52

uh, you know, um,

play06:54

and- and I hope that after this class,

play06:55

you'll be able to go out and build very meaningful machine learning applications,

play07:01

uh, either in an academic setting where, uh,

play07:04

hopefully you can apply it to your problems in mechanical engineering,

play07:08

electrical engineering, and, uh, English,

play07:10

and law and, um, uh,

play07:12

and- and- and education and all of this wonderful work that happens on campus,

play07:16

uh, as well as after you graduate from Stanford

play07:18

to be able to apply it to whatever jobs you find.

play07:21

Um, one of the things I find very exciting about machine learning is that it's no

play07:25

longer a sort of pure tech company only kind of thing, right?

play07:30

I think that many years ago,

play07:32

um, machine learning, it was like a thing that, you know,

play07:35

the computer science department would do and that

play07:38

the elite AI companies like Google and Facebook and Baidu and Microsoft would do.

play07:42

Uh, but now, it is so pervasive that even companies that are

play07:46

not traditional because there are tech companies see a huge need to apply these tools,

play07:51

and I find a lot of the most exciting work, uh, these days.

play07:54

Um, and, and, and maybe some of you guys know my history some would be biased, right?

play07:57

I- I led the Google Brain team which helped Google transform

play08:00

from what was already a great company 10 years ago to today which is,

play08:04

you know, a great AI company.

play08:05

And then I also led the AI group at Baidu,

play08:08

and, you know, led the company's technology strategy to help Baidu.

play08:11

Also, it transformed from what was already a great company

play08:14

many years ago to today arguably China's greatest AI company.

play08:18

So having led the, you know,

play08:20

built the teams that led the AI transformations of two large tech companies,

play08:24

I, I, I feel like that's a great thing to do.

play08:27

Uh, but even beyond tech, I think that, um,

play08:29

there's a lot of exciting work to do as well to help other industries,

play08:33

to help other sectors, uh,

play08:34

embrace machine learning and use these tools effectively.

play08:37

Um, but after this class,

play08:40

I hope that each one of you will be well qualified to

play08:43

get a job at a shiny tech company and do machine learning there,

play08:46

or go into one of these other industries and do

play08:49

very valuable machine learning projects there.

play08:51

Um, and in addition,

play08:54

if any of you, um,

play08:56

are taking this class with the primary goal of, uh,

play08:59

being able to do research,

play09:01

uh, in machine learning,

play09:02

so, so, actua- so some of you I know are PhD students.

play09:06

Um, I hope that this class will also leave you well-equipped to,

play09:09

um, be able to read and understand research papers, uh,

play09:13

as well as, uh, you know,

play09:14

be qualified to start pushing forward,

play09:17

um, the state of the art, right.

play09:20

Um, so let's see.

play09:24

Um, so today, uh,

play09:29

so, so just as machine learning is evolving rapidly, um,

play09:32

the whole teaching team,

play09:34

we've been constantly updating CS229 as well.

play09:38

So, um, it's actually very interesting.

play09:39

I feel like the pace of progress in machine learning has accelerated,

play09:42

so it, it actually feels like that,

play09:45

uh, the amounts we changed the class year over year has been increasing over time.

play09:50

So- so for your friends who took the class last year, you know,

play09:53

things are a little bit different this year because

play09:55

we're, we're constantly updating the class

play09:57

to keep up with what feels like still

play09:59

accelerating progress in the whole field of machine learning.

play10:02

Um, so, so, so, so there are some logistical changes.

play10:06

For example, uh, uh, we've gone from- uh,

play10:08

what we used to hand out paper copies of handouts,

play10:11

uh, that we're, we're trying to make this class digital only.

play10:14

Uh, but let me talk a little bit about, uh,

play10:16

prerequisites as well as in case your friends have taken this class before,

play10:19

some of the differences for this year, right?

play10:22

Um, so prerequisites.

play10:24

Um, we are going to assume that,

play10:28

um, all of you have a knowledge of basic computer skills and principles.

play10:33

Uh, so, you know, Big O notation,

play10:34

queues, stacks, binary trees.

play10:36

Hopefully, you understand what all of those concepts are.

play10:39

And, uh, assume that all of you have a basic familiarity with,

play10:43

um, uh, probability, right?

play10:45

Hopefully, you know what's a random variable,

play10:47

what's the expected value of a random variable,

play10:49

what's the variance of a random variable.

play10:51

Um, and if- for some of you,

play10:53

maybe especially the SCPD students taking this remotely,

play10:56

it has been, you know,

play10:57

some number of years since you last had a probability and statistics class.

play11:01

Uh, we will have review sessions, uh,

play11:04

on, on, on Fridays, uh,

play11:05

where we'll go over some of this prerequisite material as well. But it's okay.

play11:09

Hopefully, you know what a random variable is,

play11:10

what expected value is.

play11:11

But if you're a little bit fuzzy on those concepts,

play11:14

we'll go over them again,

play11:15

um, at a- at a discussion section, uh, on Friday.

play11:19

Also, seem to be familiar with basic linear algebra.

play11:22

So hopefully that you know what's a matrix,

play11:24

what's a vector, how to multiply two matrices and multiplying matrices and a vector.

play11:28

Um, if you know what an eigenvector then that's even better.

play11:32

Uh, if you're not quite sure what an eigenvector is,

play11:34

we'll go over it that- that you, you, you better-

play11:36

uh, yeah, we'll, we'll, we'll go over it I guess.

play11:40

And then, um, a large part of this class, uh, uh, is,

play11:47

um, having you practice these ideas through the homeworks,

play11:51

uh, as well as I mention later a, uh, open-ended project.

play11:55

And so, um, one,

play11:58

uh, there are- we've actually, uh,

play11:59

until now we used to use uh MATLAB,

play12:02

uh and Octave for the programming assignments, uh,

play12:05

but this year, we're trying to shift the programming assignments to, uh,

play12:08

Python, um, and so,

play12:10

um, I think for a long time, uh,

play12:12

even today, you know,

play12:14

I sometimes use Octave to prototype because the syntax in Octave is so nice and just run,

play12:19

you know, very simple experiments very quickly.

play12:21

But I think the machine learning world, um, is,

play12:24

you know, really migrating I think from a

play12:28

MATLAB Python world to increasing- excuse me,

play12:30

MATLAB Octave world to increasingly a Python

play12:34

maybe and- and then eventually for production Java or C++, kind of world.

play12:38

And so, uh, we're rewriting a lot of the assignments

play12:44

for this class this school year.

play12:44

Having, having driving that process,

play12:46

uh, so that- so that this course,

play12:48

uh, you could do more of the assignments.

play12:50

Uh, uh, maybe most- maybe all of the assignments in,

play12:52

um, Python, uh, NumPy instead.

play12:56

Um, now, a note on the honor codes,

play12:59

um, we ask that, you know,

play13:01

we, we actually encourage you to form study groups.

play13:03

Uh, so, so you know I've been um, fascinated by education, a long time.

play13:08

I spent a long time studying education and pedagogy and how instructors

play13:12

like us can help support youth to learn more efficiently.

play13:15

And one of the lessons I've learned from

play13:17

the educational research literature is that the highly technical classes like this,

play13:21

if you form study groups, uh,

play13:23

you will probably have an easier time, right?

play13:26

So, so CS229, we go for the highly technical material.

play13:29

There's a lot of math, some of the problems are hard and if you have

play13:31

a group of friends to study with, uh,

play13:34

you probably have an easier time uh, uh,

play13:36

because you can now ask each other questions and work together and help each other.

play13:39

Um, where we ask you to draw the line or what we ask

play13:43

you to, to, to do relative to Stanford's,

play13:46

uh, Honor Code is, um,

play13:48

we ask that you do the homework problems by yourself, right?

play13:51

Uh, and, and, and most specifically, um,

play13:54

it's okay to discuss the homework problems with friends,

play13:56

but if you, um,

play13:58

but after discussing homework problems with friends,

play13:59

we ask you to go back and write out the solutions by yourself, uh,

play14:03

without referring to notes that,

play14:05

you know, you and your friends had developed together, okay?

play14:08

Um, the class's honor code is written clearly

play14:11

on the class handouts posted digitally on the website.

play14:15

So if you ever have any questions about what

play14:18

is allowed collaboration and what isn't allowed, uh,

play14:20

please refer to that written document on

play14:22

the course website where we describe this more clearly, but,

play14:25

um, out of respect for the Stanford honor code as well as for,

play14:29

uh, uh, you know,

play14:30

for, for, for students kind of doing their own work,

play14:33

we asked you to basically do your own work, uh,

play14:35

for the- it's okay to discuss it,

play14:38

but after discussing homework problems with friends, ultimately,

play14:40

we ask you to write up your problems by yourself so that

play14:43

the homework submissions reflect your own work, right?

play14:47

Um, and I care about this because it turns out that having CS 229,

play14:52

you know, CS 229 is one of those classes that employers recognize.

play14:56

Uh- uh, I don't know if you guys know,

play14:57

but there have been, um,

play14:59

companies that have put up job ads that say stuff like,

play15:02

"So long as you've got- so long as you completed

play15:05

CS 229 we guarantee you get an interview," right?

play15:08

[LAUGHTER] I've- I've seen stuff like that.

play15:09

And so I think you know in order to, to maintain

play15:13

that sanctity of what it means to be a CS 229 completer,

play15:16

I think, um, and I'll ask all of you so that- really do your homework.

play15:20

Um, or stay within the bounds of acceptable,

play15:22

acceptable collaboration relative to the honor code.

play15:26

Um, let's see.

play15:29

And I think that um, uh,

play15:30

if- uh, you know what?

play15:34

This is, um, [NOISE] yeah.

play15:36

And I think that, uh,

play15:38

one of the best parts of CS 229,

play15:41

it turns out is, um, excuse me.

play15:46

So I'm trying, sorry, I'm going to try looking for my mouse cursor.

play16:06

Uh, all right. Sorry about that.

play16:11

My- my- my displays are not mirrored.

play16:14

So this is a little bit awkward.

play16:21

Um, so one of the best parts of the class is- oh,

play16:29

shoot. Sorry about that.

play16:31

[LAUGHTER]

play16:33

All right, never mind. I won't do this.

play16:36

Um, you could do, you could do it yourself online later.

play16:39

Um, yeah, I started

play16:43

using- I started using Firefox recently in addition to Chrome here. It's a mix up.

play16:49

Um, one of the best parts of, um,

play16:52

the class is, um, the class project.

play16:57

Um, and so, you know,

play16:58

one of the goals of the class is to leave you

play17:00

well-qualified to do a meaningful machine learning project.

play17:03

And so, uh, one of the best ways to make sure you have that skill set

play17:08

is through this class and hopefully with the help of some of our TAs.

play17:12

Uh, we wanna support you to work on

play17:15

a small group to complete a meaningful machine learning project.

play17:19

Um, and so one thing I hope you start doing, you know,

play17:22

later today, uh, is to start brainstorming maybe with your friends.

play17:26

Um, some of the- some of the class projects you might work on.

play17:30

Uh, and the most common class project that, you know,

play17:33

people do in CS 229 is to pick an area or pick an application that excites you and

play17:39

to apply machine learning to it and see if you can

play17:41

build a good machine learning system for some application area.

play17:45

And so, um, if you go to the course website, you know,

play17:47

cs229.stanford.edu and look at previous year's projects,

play17:51

you ha- you, you see machine learning projects applied to pretty much,

play17:54

you know, pretty much every imaginable application under the sun.

play17:58

Everything from I don't know,

play17:59

diagnosing cancer to creating art to, uh,

play18:03

lots of, um, uh, projects applied to other areas of engineering, uh,

play18:07

applying to application areas in EE,

play18:09

or Mechanical engineering, or Civil engineering,

play18:11

or Earthquake engineering, and so on, uh,

play18:13

to applying it to understand literature,

play18:15

to applying it to um, uh, I don't know.

play18:18

And, and, and, and, and so, uh,

play18:19

if you look at the previous year's projects

play18:22

of many of which are posted on the course website.

play18:24

You could use that as inspiration to see the types of projects students complete,

play18:28

completing this class are able to do and also encourage you to, um, uh,

play18:33

you can look at that for inspiration to get

play18:36

a sense of what you'll be able to do at the end-

play18:38

conclusion of this class and also see if looking at

play18:41

previous year's projects gives you inspiration for what,

play18:45

um, you might do yourself.

play18:47

Uh, so we asked you to- we, we invite you I guess to

play18:50

do class projects in small groups and so, um,

play18:54

after class today, also encourage you to start

play18:56

making friends in the class both for the purpose of forming

play18:59

study groups as well as with the purpose of maybe finding

play19:01

a small group to do a class project with.

play19:04

Um, uh, we asked you to form project groups of,

play19:08

um, up to size three.

play19:09

Uh, uh, most project groups end up being size two or three.

play19:13

Um, if you insist on doing it by yourself,

play19:15

right without any partners that's actually okay too.

play19:17

You're welcome to do that.

play19:19

But, uh, but- but I think often, you know,

play19:21

having one or two others to work with may give you an easier time.

play19:24

And for projects of exceptional scope,

play19:27

if you have a very very large project,

play19:28

that just cannot be done by three people.

play19:30

Um, uh, sometimes, you know,

play19:32

let us know and we're open to- with, with to some project groups of size four,

play19:38

but our expectation- but we do hold projects, you know,

play19:41

with a group of four to a higher standard than projects with size one to three, okay.

play19:46

So- so what that means is that if your project team size is one,

play19:50

two or three persons,

play19:51

the grading is one criteria.

play19:53

If your project group is bigger than three persons,

play19:56

we use a stricter criteria when it comes to grading class projects.

play20:00

Okay. Um, and that, that reminds me um,

play20:04

uh, I know that uh- let's see.

play20:06

So for most of you since this- since this

play20:08

started 9:30 AM on the first day of the quarter,

play20:11

uh, for many of you,

play20:12

this may be- this may be your very first class at Stanford.

play20:15

How many of you, this is your very first class at Stanford?

play20:18

Wow. Cool. Okay. Awesome. Great. Welcome to Stanford.

play20:21

[LAUGHTER]

play20:22

Uh, and if someone next to

play20:24

you just raise their hand- uh actually, rai- raise your hand again.

play20:27

So I hope that, you know, maybe after class today,

play20:29

if someone next to you raised a hand, uh,

play20:31

help welcome them to Stanford, and

play20:33

then, say hi and introduce yourself and make friends on the way.

play20:35

Yeah. Cool. Nice, nice to see so many of you here.

play20:38

Um.

play20:40

[NOISE]

play20:44

All right. So um,

play20:49

just a bit more on logistics, uh-

play20:52

So, um, let's see,

play20:57

in addition to the main lectures that we'll have here,

play21:00

uh, on Mondays and Wednesdays,

play21:03

um, CS229 also has discussion sections, uh,

play21:06

on- held on Fridays that are- and everything we do including the- all the,

play21:10

all the lectures and discussion sections are recorded and broadcast through SCPD,

play21:15

uh, through the online websites.

play21:17

Um, and one of- and,

play21:20

uh, discussion sections are taught,

play21:22

uh, usually by the TAs on Fridays and attendance at discussion sections is optional.

play21:28

Uh, and what I mean is that, um, you- you know,

play21:31

you- 100% promise,

play21:32

there won't be material on the midterm that will sneak in from this kind of section.

play21:36

So it's 100% optional.

play21:38

Uh, and you will be able to do all the homework and

play21:40

the projects without attending the discussion section.

play21:43

But what we'll use the discussion section for,

play21:45

uh, for the first three discussion sections.

play21:47

So, you know, this week, next week, uh, the week after that,

play21:49

we'll use the discussion sections to go over prerequisite material in greater depth.

play21:54

So, uh, go over, uh,

play21:55

linear algebra, basic probability statistics,

play21:58

teach a little bit about Python NumPy in

play22:00

case you're less familiar with those frameworks.

play22:03

Uh, so we'll do that for the first few weeks.

play22:05

And then for the discussion sections that are held later this quarter,

play22:08

we'll usually use them to go over more advanced optional material.

play22:13

Uh, for example, um,

play22:14

CS229, most of the learning algorithms,

play22:16

you- you hear about in a class rely on convex optimization algorithms,

play22:21

but we want to focus the class on

play22:24

the learning algorithms and spend less time on convex optimization.

play22:27

So you want to come and hear about more advanced concepts in convex optimization.

play22:31

We'll defer that to the discussion section.

play22:34

Uh, and then, there, there are few other advanced topics,

play22:37

uh, Hidden Markov Models, time series,

play22:39

uh, that we're planning to defer to the,

play22:42

um, Friday discussion sections.

play22:45

Okay. Um, so, uh, let's see.

play22:51

Um, cool, and, uh, and,

play22:54

um, a final bit of logistics, um, uh,

play22:59

for- there are digital tools that some of you have seen, but, um,

play23:04

for this class, we'll drive a lot of the discussion through the,

play23:07

uh, online website Piazza.

play23:09

How- how many of you have used Piazza before? Okay, cool, mostly.

play23:12

Wow, all of you?

play23:13

That's very amazing. Uh, good.

play23:16

So, so, uh, online discussion board

play23:18

for those of you that haven't seen it before, but, um,

play23:21

I definitely encourage you to participate actively

play23:24

on Piazza and also to answer other student's questions.

play23:28

I think that one of the best ways to learn as well as contribute, you know,

play23:32

back to the class as a whole is if you see someone else ask a question on Piazza,

play23:36

if you jump in and help answer that, uh,

play23:38

that, that often helps you and helps your classmates.

play23:41

I strongly encourage you to do that.

play23:44

For those of you that have a private question,

play23:47

you know, sometimes we have students, um, uh,

play23:49

reaching out to us to- with a personal matter or something that, you know,

play23:55

is not appropriate to share in a public forum in which case you're welcome

play23:58

to email us at the class email address as well.

play24:01

Uh, and we answer in, in the class email address- the cla-

play24:04

teaching staff's email address on the course website,

play24:06

you can find it there and contact us.

play24:08

But for anything technical,

play24:09

anything reasonable to share with the class, uh,

play24:12

which includes most technical questions and most logistical questions, right?

play24:16

Questions like, you know,

play24:18

can you confirm what date is midterm,

play24:19

or, or, you know, what happens?

play24:21

Uh, can you confirm when is the handout for this going out and so on?

play24:25

For questions that are not personal or private in nature,

play24:28

I strongly encourage you to post on Piazza rather than emailing us because statistically,

play24:33

you actually get a faster answer, uh,

play24:35

posting it on- post- posting on Piazza than- than, you know,

play24:38

if you wait for one of us to respond to you, um,

play24:41

and we'll be using Gradescope as well,

play24:43

um, to- for, for online grading.

play24:45

And then, if, if you don't know what Gradescope is, don't worry about it.

play24:48

We'll, we'll, we'll send you links and show you how to use it later.

play24:53

Um, oh, and, uh, again,

play24:56

relative to- one last logistical thing to plan for, um,

play25:00

unlike previous, um, uh,

play25:03

years where we taught CS229,

play25:06

uh, so we're constantly updating the syllabus, right?

play25:08

The technical content to try to show you the latest machine learning algorithms, uh,

play25:12

and the two big logistical changes we're making this year,

play25:16

I guess one is, uh,

play25:17

Python instead of MATLAB,

play25:19

and the other one is, um,

play25:21

instead of having a midterm exam, you know,

play25:25

there's a timed midterm, uh,

play25:26

we're planning to have a take-home midterm, uh, this course, instead.

play25:31

So I, I know some people just breathed in sharply when I said that.

play25:36

[LAUGHTER] I don't know what that means.

play25:37

[LAUGHTER] Was that shock or happiness? I don't know.

play25:40

Okay. Don't worry, midterms are fun.

play25:41

You- you'll, you'll love it.

play25:43

[LAUGHTER]

play25:45

All right.

play25:47

So that's it for the- that's it for the logistical aspects.

play25:54

Um, let me check with the- so let- let me check if there are any questions.

play26:02

Oh, yeah, go ahead.

play26:03

On campus, are those courses offered every quarter [inaudible].

play26:15

Yeah. So that's interesting. Uh, let's see.

play26:18

I think it's offered in spring.

play26:20

And one other person. Oh, yes, is teaching it.

play26:25

So someone else is teaching it in spring quarter.

play26:27

Um, uh, I actually did not know it was gonna be offered in winter.

play26:34

[inaudible]

play26:35

Yeah.

play26:36

[inaudible].

play26:38

Yeah, right, yeah. So- so I think a free guide and teaching it in- sorry,

play26:47

in their [inaudible] and you are right, are teaching it in, uh,

play26:50

spring, uh, and I don't think it is offered in winter.

play26:53

[inaudible].

play26:58

Will the session be recorded? Yes, they will be.

play27:00

Oh, and by the way, if, if, if you wonder

play27:03

why I'm recording that I'm repeating the question,

play27:05

I know it feels weird, I'm recording with a microphone,

play27:07

so that- so that people watching this at home can hear the question.

play27:10

But, uh, both the lectures and the discussion sections,

play27:13

uh, will be- will be recorded and put on the website.

play27:17

Uh, maybe the one thing we do that's not

play27:19

recorded and broadcast are the office hours. Great. Isn't that right?

play27:22

[LAUGHTER]

play27:24

Oh, oh, but,

play27:24

uh, I think, uh, this year,

play27:26

uh, we have a 60-hour, how many hour?

play27:29

Well, 60 office hours.

play27:30

Uh, 60 office hours per week. Right, yeah.

play27:33

[LAUGHTER] So- so- so hopefully,

play27:35

I- I just again,

play27:36

we- we're constantly trying to improve the course.

play27:38

In previous years, one of the feedback we got

play27:40

was that the office hours were really crowded.

play27:42

So- so we have 60 hour- 60 hours,

play27:44

about 60 office hour slots per week this year. That- that seems like a lot.

play27:48

So hopefully, if you need to track down one of us,

play27:50

track down a TA to get help, hopefully,

play27:52

that- that'll make it easier for you to do so. Go ahead.

play27:54

[inaudible].

play27:58

Say that again. Well-

play28:01

[inaudible].

play28:05

Oh, well logistical things like when homeworks are due, would be covered in lectures.

play28:09

Uh, we have uh, yes,

play28:11

so we have uh, four planned homeworks. Oh sorry.

play28:14

[inaudible]

play28:16

Yeah, and if you go to the- if you go to

play28:18

the course website and you click on the syllabus link uh,

play28:20

that has a calendar with when each homework assignments go out and when they'll be due.

play28:25

Uh, so four homeworks and uh,

play28:28

project proposals due a few weeks from now and uh,

play28:31

final projects due at the end of the quarter.

play28:33

But all the, all the exact days are listed on the course website I think.

play28:37

[inaudible]

play28:42

Uh, sure yes, difference between this class and 229a.

play28:46

Um, let me think how to answer that.

play28:48

Yes. Uh, so yeah I know,

play28:51

I was debating earlier this morning how to

play28:53

answer that because I've been asked that a few times.

play28:56

Um, so I think that what has happened at Stanford is that

play29:00

the volume of demand for machine learning education is just,

play29:04

right skyrocketing because anything everyone sees,

play29:07

everyone wants to learn this stuff and so um,

play29:09

uh, so within- so

play29:12

the computer science department has been trying to grow

play29:14

the number of machine learning offerings we have.

play29:17

Um, uh, we actually kept the enrollments to

play29:20

CS229a at a relatively low number at 100 students.

play29:24

So I actually don't want to encourage too many of you to sign up because uh,

play29:28

I think we might be hitting the enrollment cap already so,

play29:31

so please don't all sign up for CS229a because um,

play29:35

we- CS229a, does not have the capacity this quarter but since CS229a is uh, um,

play29:41

much less mathematical and much more applied,

play29:45

uh, uh, a relatively more applied version of machine learning and uh,

play29:51

so I, I guess I'm teaching CS229a and CS230 and CS229, this quarter.

play29:55

Of the three, CS229,

play29:57

is the most mathematical.

play29:59

Um, it is a little bit less applied than

play30:02

CS229a which is more applied machine learning and CS230 which is deep learning.

play30:06

My advice to students is that um,

play30:08

CS229, uh, CS229a,

play30:11

excuse me, let me write this down.

play30:13

I think I'm-

play30:14

so CS229a, uh,

play30:23

is taught in a flipped classroom format which means that, uh,

play30:26

since taking it, we'll mainly watch videos um,

play30:30

on the Coursera website and do a lot of uh,

play30:33

programming exercises and then, meet for weekly discussion sections.

play30:37

Uh, but there's a smaller class with [inaudible] .

play30:40

Um, I, I would advise you that um,

play30:43

if you feel ready for CS229 and CS230 to do those uh, but CS229,

play30:50

you know, because of the math we do, this is a,

play30:53

this is a very heavy workload and pretty challenging class and so,

play30:58

if you're not sure you're ready for CS229 and CS229a,

play31:01

it may be a good thing to,

play31:04

to, to take first, uh,

play31:06

and then uh, CS229, CS229a

play31:10

cover a broader range of machine learning algorithms uh,

play31:14

and CS230 is more focused on deep learning algorithms specifically, right.

play31:19

Which is a much narrow set of algorithms but it is,

play31:21

you know, one of the hardest areas of deep learning.

play31:24

Uh, there is not that much overlap in content between the three classes.

play31:28

So if you actually take all three,

play31:30

you'll learn relatively different things from all of them uh, in the past,

play31:34

we've had students simultaneously take 229 and 229a and there is a little bit of overlap.

play31:39

You know, they, they do kind of cover

play31:41

related algorithms but from different points of view.

play31:43

So, so some people actually take multiple of these courses at the same time.

play31:47

Uh, but 229a is more applied, a bit more,

play31:51

you know practical know-how hands-on and so on and,

play31:54

and uh, much less mathematical.

play31:57

Uh, and, and CS230 is also less

play32:00

mathematical more applied more about kind of getting it to work where CS229a,

play32:05

um, we do much more mathematical derivations in CS229.

play32:10

Cool, any questions? Yes, someone had their hand up.

play32:16

[inaudible]

play32:23

So uh, once you say that what- I would

play32:28

generally prefer students not do that in the interest of time but what, what do you want?

play32:33

[inaudible]

play32:37

Oh, I see, sure go for it.

play32:39

Who is enrolled in 229 and 230?

play32:41

Oh not that many of you, interesting.

play32:44

Oh, that's actually interesting.

play32:46

Cool. Yeah. Thank you, yeah, I just didn't want to set

play32:49

the presence of students using this as a forum to run surveys.

play32:52

[LAUGHTER]

play32:52

That was, that was, that was,

play32:54

that that was an interesting question.

play32:55

So thank you.

play32:55

[LAUGHTER]

play32:58

Um, cool.

play33:00

All right, and, and by the way I think uh, you know,

play33:04

just one thing about Stanford is the

play33:06

AI world and machine learning world,

play33:08

AI is bigger than machine learning right

play33:10

and machine learning is bigger than deep learning.

play33:11

Um, one of the great things about being a Stanford student is,

play33:15

you can and I think should take multiple classes, right.

play33:19

I think that your CS229,

play33:21

has for many years been the core of the machine learning world at Stanford.

play33:24

Uh, but even beyond CS229,

play33:28

it's worth your while to take multiple classes and getting multiple perspectives.

play33:32

So, so if you want to uh,

play33:34

be really effective, you know,

play33:36

after you graduate from Stanford,

play33:37

you do wanna be an expert in machine learning.

play33:39

You do wanna be an expert in deep learning.

play33:41

Uh, and you probably wanna know probability statistics.

play33:43

Maybe you wanna know a bit of convex optimization, and maybe you

play33:46

wanna know a bit more about reinforcement learning,

play33:48

know a ittle bit about planning,

play33:50

know a bit about lots of things.

play33:51

So, so I actually encourage you to take multiple classes I guess.

play33:58

Cool. All right.

play34:00

Good. Um, if there are no more questions,

play34:04

let's go on to talk a bit about some machine learning.

play34:11

So um, all right,

play34:15

so the remainder of this class,

play34:17

what I'd like to do is um,

play34:20

give a quick overview of uh,

play34:23

you know, the major uh,

play34:25

areas of machine learning and also um,

play34:30

and, and also give you a sort of overview of the things you learn uh,

play34:34

in the next 10 weeks.

play34:35

So, you know, what is machine learning?

play34:38

Right. It seems to be everywhere these days and it's useful for so many spaces,

play34:42

and, and I think that um,

play34:44

and uh, you know, and uh, uh,

play34:47

and I, I feel like they uh- just to share with you my personal bias, right.

play34:52

You, you read the news about these people who are making

play34:54

so much money building learning algorithms. I think that's great.

play34:58

I hope, I hope all of you go make a lot of money

play35:00

but the thing I find even more exciting is,

play35:02

is the meaningful work we could do.

play35:04

I think that, you know,

play35:05

I think that every time there's a major technological disruption which there is now,

play35:09

through machine learning um,

play35:11

it gives us an opportunity to remake large parts of the world and if we behave ethically

play35:15

in a principled way and use the superpowers of machine learning to do things that,

play35:20

you know, helps people's lives, right.

play35:22

Maybe we could um, uh,

play35:24

maybe you can improve the healthcare system,

play35:26

maybe you can improve give every child a personalized tutor.

play35:30

Uh, maybe we can make our democracy run better rather than make it run worse.

play35:34

But I think that um,

play35:35

the meaning I find in machine learning is that there's so many people that

play35:40

are so eager for us to go in and help them with these tools that um,

play35:44

if, if you become good at these tools,

play35:47

it gives you an opportunity to really remake some piece,

play35:50

some meaningful piece of the world.

play35:52

Uh, hopefully in a way that helps other people and makes the world kind of,

play35:56

makes the world a better place is very cliche in Silicon Valley.

play35:59

But, but I think, you know, with these tools,

play36:01

you actually have the power to do

play36:03

that and if you go make a ton of money, that's great too.

play36:05

But I find uh, much greater meaning of the work we could do.

play36:08

Um, it gives us a unique opportunity to do these things, right.

play36:13

But um, despite all the excitement of machine learning.

play36:16

What is machine learning?

play36:17

So let me give you a couple um,

play36:19

definitions of machine learning.

play36:21

Um, Arthur Samuel whose claim to fame was uh,

play36:25

building a checkers playing program,

play36:27

uh, defined it as follows.

play36:29

So field of study gives computers the ability to learn without being explicitly programmed.

play36:32

Um, and you know interesting- when,

play36:36

when Arthur Samuel many,

play36:37

many decades ago, built

play36:39

the checkers playing program.

play36:41

Uh, the debates of the day was can a computer ever do something

play36:46

that it wasn't explicitly told to do? And Arthur Samuel uh, wrote a

play36:51

checkers playing program, that through self play learns whether the patterns of uh,

play36:58

the checkerboard that are more likely to lead to win

play37:00

versus more likely to lead to a loss and learned uh,

play37:03

to be even better than Arthur Samuel the author himself at playing checkers.

play37:09

So back then, this was viewed as a remarkable result that a computer programmer,

play37:13

you know that could write a piece of

play37:15

software to do something that the computer program himself

play37:17

could not do, right, because this program became better than Arthur Samuel um,

play37:22

at, uh, uh, at,

play37:25

at, at the task of playing checkers.

play37:28

Um, and I think today we um, are

play37:31

used to computers or machine learning algorithms outperforming humans on so many tasks.

play37:37

Uh, but it turns out that when you choose a narrow task like,

play37:41

speech recognition on a certain type of task,

play37:43

you can maybe surpass human level performance.

play37:45

If you choose a narrow task like,

play37:47

playing the game of Go,

play37:48

than by throwing really,

play37:50

tons of computational power at it and self play.

play37:53

Uh, uh, uh you can have a computer,

play37:55

you know become very good at,

play37:57

at these narrow tasks.

play37:59

But this is maybe one of the first such examples in the history of computing. Um.

play38:06

Uh, and I think this is the one of the most widely cited, um, definitions right.

play38:12

Gives computers the ability learn without being explicitly programmed.

play38:15

Um, my friend Tom Mitchell in his textbook,

play38:19

defined this as a Well-posed Learning Problem.

play38:22

Uh, a program is said to learn from

play38:25

experience E with respect to task T and some performance measure P,

play38:28

if its performance on T, as measured by P,

play38:30

improves with experience E. And I- I asked Tom this.

play38:33

I asked Tom if, um,

play38:34

he wrote this definition just because he wanted it to

play38:37

rhyme and [LAUGHTER] he, he, he, he, he did not say yes,

play38:41

but I, I, I don't know.

play38:43

Um, but in this definition,

play38:46

the experienced E. For- for the case of playing checkers,

play38:49

the experience E would be the experience of having

play38:51

a checkers play- program played tons of games against itself.

play38:54

Uh, so computers lots of patients and

play38:57

sit there for days playing games or checkers against itself.

play39:00

So that's experience E.

play39:01

The task T is the task of playing checkers,

play39:04

the performance measure P maybe,

play39:05

um, what's the chance of this program

play39:08

winning the next game of checkers it plays against the next opponent.

play39:11

Right. So- so we say that, ah,

play39:13

this is a well-posed learning problem, learning the game of checkers.

play39:16

Now, within this, um,

play39:19

set of ideas with machine learning,

play39:21

there are many different tools we use in machine learning.

play39:25

And so in the next 10 weeks,

play39:27

you'll learn about a variety of these different tools.

play39:31

Um, and so the first of them and the most widely used one is supervised learning.

play39:36

Um, let's see.

play39:38

I wanna switch to the white board.

play39:39

Do you guys know how to raise the screen?

play39:43

[NOISE]

play40:00

So what I wanna do today is really go over some of the major categories of,

play40:04

uh, Machine Learning Tools, and, uh,

play40:06

and so what you learn in the next,

play40:09

um, ah, by the end of this quarter.

play40:12

So the most widely used machine learning tool is,

play40:21

uh, today is supervised learning.

play40:23

Actually, let me check, how, how many of you know what supervised learning is?

play40:25

Ah, like two-thirds, half of you maybe.

play40:29

Okay cool. Let me, let me just briefly define it.

play40:31

Um, here's one example.

play40:33

Let's say, you have a database of

play40:37

housing prices and so I'm gonna plot your dataset where on the horizontal axis,

play40:42

I'm- I'm gonna plot the size of the house in square feet.

play40:47

And on the vertical axis,

play40:48

we'll plot the price of the house.

play40:51

Right. And, um, maybe your dataset looks like that.

play40:58

Um, and so horizontal axis,

play41:00

I guess we'd call this X and vertical axis we'll call that Y.

play41:05

So, um, the supervised learning problem is given a dataset

play41:09

like this to find the relationship mapping from X to Y.

play41:13

And so, um, for example,

play41:16

let's say- let's say- let's say you have- let's

play41:18

say you're fortunate enough to own a house in Palo Alto.

play41:21

Right. Ah, and you're trying to sell it,

play41:23

and you want to know how the price of the house.

play41:25

So maybe your house has a size,

play41:28

you know, of that amount on the horizontal axis.

play41:31

I don't know, maybe this is 500 square feet,

play41:34

1,000 square feet, 1,500 square feet.

play41:37

So your house is, ah, 1,250 square feet.

play41:40

Right. And you want to know,

play41:42

you know, how do you price this house.

play41:44

So given this dataset,

play41:45

one thing you can do is,

play41:46

um, fit a straight line to it.

play41:50

Right. And then you could estimate or predicts the price

play41:54

to be whatever value you read off on the, um, vertical axis.

play41:58

So in supervised learning,

play42:00

you are given a dataset with, ah,

play42:04

inputs X and labels Y,

play42:07

and your goal is to learn a mapping from X to Y.

play42:12

Right. Now, um, fitting a straight line to data is maybe the simplest possible.

play42:18

Maybe the simplest possible learning algorithm,

play42:20

maybe one of the simplest poss- learning algorithms.

play42:23

Um, given a dataset like this,

play42:25

there are many possible ways to learn a mapping,

play42:28

to learn the function mapping from the input size to the estimated price.

play42:32

And so, um, maybe you wanna fit a quadratic function instead,

play42:36

maybe that actually fits the data a little bit better.

play42:38

And so how do you choose among different models will be, ah,

play42:40

either automatically or manual intervention will be-

play42:43

will be something we'll spend a lot time talking about.

play42:47

Now to give a little bit more.

play42:49

Um, to define a few more things.

play42:51

This example is a problem called a regression problem.

play42:57

And the term regression refers to

play43:00

that the value y you're trying to predict is continuous.

play43:04

Right. Um, in contrast,

play43:07

here's a- here's a different type of problem.

play43:10

Um, so problem that some of my friends were working on,

play43:13

and- and I'll simplify it was- was a healthcare problem, where, ah,

play43:16

they were looking at, uh,

play43:18

breast cancer or breast tumors,

play43:20

um, and trying to decide if a tumor is benign or malignant.

play43:25

Right. So a tumor is a lump in a- in a woman's breast, um,

play43:29

is- can be ma- malign,

play43:32

or cancerous, um, or benign,

play43:34

meaning you know, roughly it's not that harmful.

play43:37

And so if on the horizontal axis,

play43:40

you plot the size of a tumor.

play43:43

Um, and on the vertical axis,

play43:46

you plot is it malignant or not.

play43:50

Malignant means harmful, right.

play43:52

Um, and some tumors are harmful some are not.

play43:56

And so whether it is malignant or not,

play43:58

takes only two values, 1 or 0.

play44:03

And so you may have a dataset, um, like that.

play44:14

Right. Ah, and given this,

play44:16

can you learn a mapping from X to Y,

play44:19

so that if a new patient walks into your office, uh,

play44:22

walks in the doctor's office and the tumor size is,

play44:25

you know say, this,

play44:27

can the learning algorithm figure out from this data that it was probably,

play44:31

well, based on this dataset,

play44:32

looks like there's- there's a high chance that that tumor is, um, malignant.

play44:37

Um, so, ah, so this is an example of

play44:43

a classification problem and

play44:49

the term classification refers to that Y here takes on a discrete number of variables.

play44:55

So for a regression problem,

play44:56

Y is a real number.

play44:58

I guess technically prices can be rounded off to the nearest dollar and cents,

play45:02

so prices aren't really real numbers.

play45:04

Um, you know that- because you'd probably not price it,

play45:07

how's it like Pi times 1 million or whatever.

play45:10

Ah, but, so, so- but for all practical purposes prices are continuous

play45:14

so we call them housing price prediction to be a regression problem,

play45:17

whereas if you have, ah, two values of possible output,

play45:20

0 and 1, call it a classification problem.

play45:22

Um, if you have K discrete outputs so,

play45:25

uh, if the tumor can be, uh,

play45:27

malignant or if there are five types of cancer, right,

play45:31

so you have one of five possible outputs,

play45:33

then that's also a classification problem.

play45:35

If the output is discrete.

play45:37

Now, um, I wanna find a different way to visualize this dataset which is,

play45:44

um, let me draw a line on top.

play45:47

And I'm just going to, you know,

play45:49

map all this data on the horizontal axis upward onto a line.

play45:53

But let me show you what I'm gonna do.

play45:55

I'm going to use a symbol O to denote.

play46:06

Right. Um, I hope what I did was clear.

play46:10

So I took the two sets of examples,

play46:12

uh, the positive and negative examples.

play46:14

Positive example was this 1,

play46:15

negative example was 0.

play46:17

And I took all of these examples and- and kinda pushed them up onto a straight line,

play46:22

and I use two symbols,

play46:24

I use O's to denote negative examples and I use crosses to denote positive examples.

play46:29

Okay. So this is just a different way of visualizing the same data, um,

play46:35

by drawing it on the line and using, you know,

play46:37

two symbols to denote the two discrete values 0 and 1, right?

play46:42

So, um, it turns out that, uh, uh,

play46:46

in both of these examples,

play46:47

the input X was one-dimensional,

play46:50

it was a single real number.

play46:51

For most of the, um,

play46:53

machine learning applications you work with,

play46:55

the input X will be multi-dimensional.

play46:57

You won't be given just one number and asked to predict another number.

play47:01

Instead, you'll often be given, uh,

play47:04

multiple features and multiple numbers to predict another number.

play47:07

So for example, instead of just using a

play47:10

tumor size to predict- to estimate malignancy- malignant versus benign tumors, um,

play47:16

you may instead have two features where one is

play47:21

tumor size and the second is age of the patient,

play47:26

and be given a dataset, [NOISE]

play47:43

right? And be given a dataset that looks like that, right?

play47:48

Where now your task is, um,

play47:51

given two input features,

play47:53

so X is tumor size and age,

play47:55

you know, like a two-dimensional vector,

play47:57

um, and your task is given, uh,

play48:00

these two input features,

play48:02

um, to predict whether a given tumor is malignant or benign.

play48:06

So if a new patient walks in a doctor's office

play48:08

and that the tumor size is here and the age is here,

play48:11

so that point there,

play48:13

then hopefully you can conclude that, you know,

play48:15

this patient's tumor is probably benign, right?

play48:17

Corresponding the O, that negative example.

play48:20

Um, and so what thing- one thing you'll learn, uh,

play48:23

next week is a learning algorithm that can fit a straight line to the data as follows,

play48:30

kinda like that, to separate out the positive and negative examples.

play48:33

Separate out the O's and the crosses.

play48:35

And so next week, you'll learn about the logistic regression algorithm which,

play48:39

um, which can do that.

play48:41

Okay? So, um, one of the most interesting things you'll learn about is, uh, let's see.

play48:49

So in this example,

play48:51

I drew a dataset with two input features, um,

play48:54

when- so I have friends that actually worked on

play48:57

the breast cancer, uh, prediction problem,

play48:59

and in practice you usually have a lot more than one or two features,

play49:03

and usually you have so many features you can't plot them on the board, right?

play49:06

And so for an actual breast cancer prediction problem,

play49:09

my friends are working on this were- were using many other features such as,

play49:13

don't worry about what these me- mean,

play49:15

I guess clump thickness,

play49:16

uh, you know, uniformity of cell size,

play49:24

uniformity of cell shape, right?

play49:29

Um, uh, adhesion, how well the cells stick together.

play49:33

Don't worry about what this means but, uh,

play49:35

if you are actually doing this in a- in a actual medical application,

play49:39

there's a good chance that you'll be using a lot more features than just two.

play49:42

Uh, and this means that you actually can't plot this data,

play49:45

right? It's two high-dimensional.

play49:46

You can't plot things higher than 3-dimensional or maybe 4-dimensional,

play49:49

or something like that and so when we have lots of

play49:51

features it's actually difficult to plot this data.

play49:54

I'll come back to this in a second in learning theory.

play49:56

Um, and, uh, one of the things you'll learn about- so as we develop learning algorithms,

play50:03

you'll learn how to build, um,

play50:05

regression algorithms or classification algorithms that can deal

play50:07

with these relatively large number of features.

play50:11

One of the, uh,

play50:12

most fascinating results you learn is that, um,

play50:15

[NOISE] you'll also learn about an algorithm called the Support Vector Machine which uses

play50:20

not one or two or three or 10 or 100 or a million input features,

play50:26

but uses an infinite number of input features, right?

play50:30

And so, so, so just to be clear, if in

play50:32

this example the state of a patient were represents as one number,

play50:36

you know, tumor size, uh,

play50:38

in this example we had two features.

play50:39

So the state of a patient were represented using two numbers,

play50:42

the tumor size and the age.

play50:44

If you use this list of features maybe

play50:46

a patient that's represented with five or six numbers.

play50:48

Uh, but there's an algorithm called the support vector machine that

play50:51

allows you to use an infinite-dimensional vector,

play50:57

um, to represent a patient.

play51:00

And, um, how do you deal with that

play51:04

and how can the computer even store an infinite-dimensional vector, right?

play51:07

I mean, you know, computer memory,

play51:09

you can store one row number, two row numbers,

play51:11

but you can't store an infinite number of row numbers in

play51:14

a computer without running out of memory or processor speed or whatever.

play51:17

So so how do you do that?

play51:18

Uh, so when we talk about support vector machines

play51:21

and specifically the technical method called kernels,

play51:25

you'll learn how to build learning algorithms that work with, uh,

play51:28

so that the infinitely long lists of features,

play51:31

infinitely long list of feature of- for for- which which- and you can

play51:35

imagine that if you have an infinitely long list of numbers to represent a patient,

play51:39

that might give you a lot of information about that patient and so that

play51:43

is one of the relatively effective learning algorithms to solve problems, okay?

play51:49

Um, so that's supervised learning.

play51:53

And, you know, let me just,

play51:55

um, uh, play a video,

play51:58

um, show you a fun- slightly older example

play52:02

of supervised learning to give you a sense of what this means.

play52:05

[NOISE] But at the heart of supervised learning is the idea that during training, uh,

play52:12

you are given inputs X together with the labels Y and you give it both at the same time,

play52:17

and the job of your learning algorithm is to, uh,

play52:21

find a mapping so that given a new X,

play52:24

you can map it to the most appropriate output Y.

play52:27

Um, so this is a very old video, uh, made by, um,

play52:31

DA Pomerleau and we've known him for a long time as well, uh,

play52:33

using supervised learning for autonomous driving.

play52:36

Uh, this is not state of the art for autonomous driving anymore,

play52:39

but it actually does remarkably well.

play52:41

Oh, and, uh, um, as you, uh,

play52:43

you hear a few technical terms like back-propagation,

play52:46

you'll learn all those techniques in this class, uh,

play52:49

and by the end of class, you'll either build

play52:51

a learning algorithm much more effective than what you see here.

play52:53

But let's- let's- let's see this application.

play52:58

Uh, could you turn up the volume maybe have that?

play53:02

Are you guys getting volume audio?

play53:04

[BACKGROUND]

play53:07

Oh, I see.

play53:12

All right, I'll narrate this.

play53:15

[LAUGHTER]

play53:17

So I'll be using artificial neural network to drive this vehicle that,

play53:20

uh, was built at Carnegie Mellon University, uh, many years ago.

play53:24

And what happens is, uh,

play53:26

during training, it watches the human, um,

play53:29

drive the vehicle and I think 10 times per second,

play53:32

uh, it digitizes the image in front of the vehicle.

play53:35

And, um, so that's a picture taken by a front-facing camera.

play53:41

Um, and what it does is in order to collect labeled data,

play53:45

the car while the human is driving it,

play53:47

records both the image such as it's seeing here,

play53:51

as well as, the steering direction that was chosen by human.

play53:55

So at the bottom here is the image turned to grayscale and lower res,

play53:59

and, uh, on top,

play54:01

let me pause this for a second.

play54:03

Um, this is the driver direction,

play54:07

the font's kinda blurry but this text says driver direction.

play54:09

So this is the Y label,

play54:12

the label Y that the human driver chose.

play54:15

Um, and so the position of this white bar of

play54:18

this white blob shows how the human is choosing to steer the car.

play54:23

So in this, in this image,

play54:24

the white blob is a little bit to the left of center so the human is,

play54:27

you know, steering just a little bit to the left.

play54:29

Um, this second line here is the output of the neural network and initially,

play54:36

the neural network doesn't know how to drive,

play54:39

and so it's just outputting this white smear everywhere and it's saying,

play54:42

"No, I don't know, do I drive left, right, center?

play54:44

I don't know." So it's outputting this gray blur everywhere.

play54:47

Um, and as the algorithm learns

play54:50

using the back-propagation learning algorithm

play54:53

or gradient descents which you'll learn about,

play54:55

uh, you'll actually learn about gradient descent this Wednesday.

play54:57

Um, you see that

play54:59

the neural network's outputs becomes less and less of this white smear,

play55:03

this white blur but starts to, uh,

play55:05

become sharper, um, and starts to mimic more

play55:10

accurately the human selected driving direction.

play55:16

Right. So this, um,

play55:18

is an example of supervised learning because

play55:22

the human driver demonstrates inputs X and outputs Y,

play55:26

uh, meaning, uh, if you see this in front of the car steer like that so that's X and Y.

play55:31

And, uh, after the learning algorithm has learned,

play55:35

um, you can then,

play55:37

uh, well, he pushes a button,

play55:39

takes the hands off the steering wheel, um,

play55:42

[NOISE] and then it's using this neural network to drive itself, right?

play55:47

Digitizing the image in front of the road,

play55:50

taking this image and passing it through the learning algorithm,

play55:53

through the trained neural network,

play55:55

letting the neural networks select a steering direction,

play55:58

uh, and then using a little motor to turn the wheel.

play56:03

Um, this is slightly more advanced version which has trained two separate models;

play56:07

one for, I think, a two-lane road,

play56:09

one for a four-lane road.

play56:10

Uh, so that's the, um,

play56:12

uh, so the second and third lines this is for a two-lane road,

play56:17

this is a four-lane road.

play56:19

And the arbitrator is, is another algorithm that tries to decide whether

play56:24

the two-lane or the four-lane road model is

play56:25

the more, more appropriate one for a particular given situation.

play56:29

Um, and so as Alvin is, excuse me a one-lane road or,

play56:34

uh, a two-lane road.

play56:35

So, so, so it's driving from a one-lane road here,

play56:38

uh, to another intersection,

play56:51

um, the, uh the the algorithm realizes it should swi- switch over from,

play56:56

um, I think I forget,

play56:58

I think the one-lane neural network to the- to

play57:00

the two-lane neural network [NOISE] one of these, right?

play57:04

All right. Um.

play57:17

Okay. Oh, oh, right.

play57:20

Fine. We'll just see the final dramatic moment of

play57:22

switching from a one-way road to a two-lane road.

play57:24

[LAUGHTER]

play57:37

All right.

play57:39

Um, uh, and I think,

play57:41

you know, so this is just using supervised learning to- take as input,

play57:44

what's in front of the car to decide on the steering direction.

play57:47

This is not state of the art for how self-driving cars are built today,

play57:51

but you know, you could do some things in some limited contexts.

play57:54

Uh, uh, and I think,

play57:56

uh, in, in several weeks,

play57:57

you'll actually be able to build something that is more sophisticated than this.

play58:01

Right. Um, so after supervised learning,

play58:08

uh, we wi- will- in this class we'll spend

play58:11

a bit of time talking about machine learning strategy.

play58:14

Also, well, I think on the class notes we annotate this as a learning theory.

play58:19

But what that means is, um,

play58:20

when I give you the tools to go out and apply learning algorithms effectively.

play58:25

And I think I've been fortunate to have,

play58:28

uh, you know, to know a lot of, uh,

play58:30

uh, I, I think that,

play58:33

um, I've been fortunate to have,

play58:35

you know, over the years constantly visited lots of great tech companies.

play58:40

Uh, uh, more than once that I've that- that I've been probably associated with, right?

play58:43

But often, just to help friends out,

play58:45

I visit various tech companies,

play58:47

uh, whose products I'm sure are installed on your cell phone.

play58:51

Uh, but I often visit tech companies and you know,

play58:53

talk to the machine learning teams and see what they're doing,

play58:55

and see if I can help them out.

play58:57

And what I see is that there's a huge difference in

play59:00

the effectiveness of how

play59:02

two different teams could apply the exact same learning algorithm.

play59:06

All right? Uh, and I think that, um,

play59:09

what I've seen sadly is that

play59:12

sometimes there will be a team or even in some of the best tech companies, right?

play59:16

The, the, the, the EV, AI companies, right?

play59:18

And, and, and multiple of them,

play59:20

where you go talk to a team and they'll

play59:22

tell you about something that they've been working on for six months.

play59:25

And then, you can quickly take a look at the data and,

play59:29

and hear that they're not- the algorithm isn't

play59:31

quite working and sometimes you can look at what they're doing,

play59:34

and go yeah, you know,

play59:36

I could have told you six months ago that this approach is never gonna work, right?

play59:39

Um, and, um, what I find is that

play59:42

the most skilled machine learning practitioners are very strategic.

play59:46

By which I mean that your skill at deciding- um,

play59:50

when you work on a machine learning project,

play59:52

you have- you- you have a lot of decisions to make.

play59:54

Right? Do you collect more data?

play59:56

Do you try a different learning algorithm?

play59:58

Uh, do you rent faster GPUs to train your learning algorithm for longer?

play60:01

Or if you collect more data,

play60:03

what type of data do you collect?

play60:04

Or for- all of these architectural choices,

play60:06

using neural networks for reference machine which is regression,

play60:08

which ones do you pick?

play60:10

Um, but there are a lot of decisions you need to

play60:13

make when building these learning algorithms.

play60:16

So one thing that's quite unique to the way we teach is, uh,

play60:20

we want to help you become more systematic in driving machine learning as a,

play60:27

as a systematic engineering discipline,

play60:29

so that when one day when you are working on as machine learning project,

play60:31

you can efficiently figure out what to do next.

play60:34

Right? Um, and I sometimes make an analogy to how,

play60:37

um, to, uh, uh,

play60:39

to, to software engineering.

play60:41

Um, you know, like many years ago,

play60:44

I had a friend, um,

play60:45

that would debug code by compiling it and then,

play60:49

um, uh, this friend would look for all of the syntax errors, right?

play60:53

That, you know, C++ compiler outputs.

play60:55

And they thought that the best way to eliminate the errors

play60:59

is to delete all the lines of code with

play61:01

syntax errors and that was [LAUGHTER] their first heuristic.

play61:03

So that did not go well, right?

play61:05

Um, uh, it took me a while to persuade them to stop doing that.

play61:08

Uh, but, but, but so it turns out that, um,

play61:11

when you run a learning algorithm,

play61:13

you know, it almost never works the first time.

play61:16

All right? It's this just life.

play61:17

Uh, uh, and, and the way you go about debugging the learning algorithm will

play61:20

have a huge impact on your efficiency o- on,

play61:24

on how quickly you can build effective learning systems.

play61:27

And I think until now,

play61:29

too much of the- of this process of, uh,

play61:32

making your learning algorithms work well has been a black magic kind of process where,

play61:36

you know, has worked on this for decades.

play61:39

So when you run something,

play61:40

you don't know why it does not recognize it like, "Hey,

play61:42

what do I do and it says, Oh, yeah, do that."

play61:44

And then, and then, because he's so experienced it works,

play61:46

but I think, um,

play61:48

what we're trying to do with the discipline of machine learning

play61:50

is to evolve it from a black magic,

play61:52

tribal knowledge, experience-based thing to a systematic engineering process.

play61:57

All right. And so um, later this quarter,

play62:00

as we talk about machine learning strategy,

play62:02

we'll talk about learning theory.

play62:04

We'll try to systematically give you tools on how to,

play62:07

um, uh, go about strategizing.

play62:09

Uh, so- so it can be very efficient in, um,

play62:12

how you- how you yourself,

play62:14

how you can lead a team to build an effective learning system,

play62:17

because I don't want you to be one of those people that, you know,

play62:20

wastes six months on some direction that

play62:23

maybe could have relatively quickly figured out it was not promising.

play62:27

Or maybe one last analogy,

play62:28

if you- um, if you're used to optimizing code, right?

play62:32

Making code run faster,

play62:33

I'm not sure if you have done that.

play62:35

Uh, uh, uh, less experienced software engineers,

play62:39

who'll just dive in and optimize the code,

play62:41

they try to make it run faster, right?

play62:42

Let's take the C++ and code in assembly or something.

play62:45

But more experienced people will run a profiler to try to figure

play62:48

out what part of code is actually the bottleneck and then just focus on changing on that.

play62:52

So, uh, one of the things we hope to do this quarter is, uh,

play62:56

uh, convey to you some of these more systematic engineering principles.

play63:00

All right. And yeah.

play63:01

Oh, and actually this is very interesting.

play63:03

This is a, uh, uh, yeah.

play63:05

Actually, I've been- I've been invited,

play63:07

so actually- so how many of you have heard the machine learning journey?

play63:11

Oh, just a few of you, interesting.

play63:14

Oh, so actually, so,

play63:15

so- if any of you are interested,

play63:17

um, just in my,

play63:19

uh, spare time, uh,

play63:22

I've been writing a book,

play63:24

um, uh, to try to codify

play63:26

systematic engineering principles for machine learning and so if you are,

play63:30

uh, and so uh,

play63:32

if you want the, you know,

play63:33

free draft copy of the book,

play63:35

sign up for a mailing list here.

play63:36

I tend to just write stuff and put it on the Internet for free, yeah.

play63:39

So if you want a free draft copy of the book,

play63:42

uh, uh, you know,

play63:44

go to this website, uh,

play63:45

enter your e-mail address and the website will send you a copy of that book.

play63:49

And I'll talk a little bit about these engineering principles as well.

play63:51

Okay. All right. So, uh,

play63:55

so first subject, machine learning.

play63:56

Second subject, learning theory.

play63:59

Um, and, uh, the third major subject we'll talk about is, uh, deep learning, right?

play64:05

And so you have a lot of tools in machine learning and many of them are

play64:09

worth learning about and I use many different tools in machine learning,

play64:13

you know, for many different applications.

play64:15

There's one subset of machine learning that's really hot right now

play64:18

because it's just advancing very rapidly, which is deep learning.

play64:21

And so we'll spend a little time talking about deep learning so that you can

play64:25

understand the basics of how to train a neural network as well.

play64:29

But I think that's where CS229

play64:32

covers a much broader set of algorithms which are all useful.

play64:36

CS230, more narrowly covers just deep learning, right? Um.

play64:42

So, uh, other than deep learning slash

play64:45

after- after deep learning slash neu- neural networks the other,

play64:49

the four, four of the five major topics we'll cover will be on unsupervised learning.

play64:55

Um, so what is unsupervised learning?

play64:57

[NOISE]

play65:06

So you saw me draw a picture like this just now, right?

play65:12

And this would be a classification problem like the tumor,

play65:14

malignant, benign problems, this is a classification problem.

play65:17

And that was a supervised learning problem because you have to learn

play65:20

a function mapping from X to Y.

play65:23

Um, unsupervised learning would be if I give you a dataset like this with no labels.

play65:29

So you're just given inputs X and no Y,

play65:33

and you're asked to find me something interesting in this data,

play65:36

figure out, you know, interesting structure in this data.

play65:40

Um, and so in this dataset,

play65:41

it looks like there are two clusters,

play65:43

and then unsupervised learning algorithm

play65:46

which we learned about called K-means clustering,

play65:48

will discover this, um,

play65:49

this structure in the data.

play65:52

Um, other examples as well as learning, you know,

play65:55

if- if you actually,

play65:56

Google News is a very interesting website.

play65:58

Sometimes I use it to look up, right?

play66:00

Latest news, just this old example.

play66:02

But Google News everyday crawls or reads,

play66:06

uh, uh, I don't know, uh, uh, many many thousands or

play66:10

tens of thousands of news articles on the Internet and groups them together, right?

play66:14

For example, there's a set of articles on the BP Oil Well spill, and it has,

play66:19

uh, taken a lot of the articles written by different reporters and grouped them together.

play66:25

So you can, you know,

play66:26

figure out that what BP,

play66:28

uh, Macondo oil well, right?

play66:32

That this is a CNN article about the oil well spill,

play66:35

there's a Guardian article about oil well spill and this is

play66:37

an example of a clustering algorithm whereas taking

play66:40

these different news sources and figuring out that these are

play66:43

all stories kind of about the same thing, right?

play66:47

Um, and other examples of clustering,

play66:51

just getting data and figuring out what groups belong together.

play66:56

Um, a lot of work on, um, genetic data.

play66:59

This is a visualization of- of genetic microarray data.

play67:05

Where given data like this,

play67:06

you can group individuals into different types

play67:09

of- into individuals of different, uh, characteristics, um,

play67:14

or clustering algorithms grouping this type of data together is used to, um,

play67:19

organize computing clusters, you know,

play67:21

figure out what machines workflows are more related

play67:23

to each other and organize computing clusters appropriately.

play67:26

So take a social network like LinkedIn or Facebook or

play67:30

other social networks and figure out which are the groups of

play67:33

friends and which are the cohesive communities within a social network,

play67:37

um, or market segmentation.

play67:39

Um, actually many companies I've worked with look at

play67:41

the customer database and cluster the users together.

play67:44

So you can say that looks like we're four types of users, you know,

play67:47

looks like that, um,

play67:48

there are the, uh,

play67:50

young professionals looking to develop themselves,

play67:53

there are the, you know,

play67:54

soccer moms and soccer dads, there are this category and these categories.

play67:58

You can then market to the different market segments, um, separately.

play68:02

Uh, and- and actually,

play68:04

many years ago my friend Andrew Moore, uh, uh,

play68:07

was using this type of data for

play68:08

astronomical data analysis to group together galaxies. You have a question?

play68:12

[inaudible].

play68:17

Is unsupervised learning the same as learning clustering? No it's not.

play68:19

So unsupervised learning broadly is the concept of using unlabeled data.

play68:24

So just X and finding interesting things about it, right?

play68:27

Um, so, um, for example,

play68:30

uh, actually here's- shoot.

play68:33

This won't work with all of you will do this later in the cla- in the class I guess.

play68:37

Um, maybe I say we'll do this later.

play68:39

Cocktail party problem, um, uh,

play68:42

is another unsupervised learning problem.

play68:46

Reading the audio for this to explain this though,

play68:49

um, let me think how to explain this.

play68:52

Um, the cocktail party problem and I'll try to

play68:54

do the demo when we can get all your work on this laptop.

play68:57

Is a problem where, um,

play68:59

if you have a noisy room and you stick

play69:02

mult- multiple microphones in the room and record overlapping voices,

play69:05

um, so that no labels reaches multiple microphones,

play69:08

an array of microphones,

play69:10

in a room of lots of people talking.

play69:12

Uh, how can you have the algorithm separate out the people's voices.

play69:15

So that's an unsupervised learning problem because,

play69:18

um, there are no labels.

play69:20

So you just stick microphones in the room and have it

play69:22

record different people's voices, overlapping voices,

play69:24

you have multiple users at the same time and then

play69:26

have it try to separate out people's voices.

play69:29

And one of the programming exercises you do later is,

play69:32

if we have, you know, five people talking.

play69:35

So each microphone records five people's overlapping voices, right?

play69:40

Because, you know, each microphone hears five people at the same time.

play69:43

How can you have an algorithm separate out

play69:45

these voices so you get clean recordings of just one voice at a time.

play69:49

So that's called the cocktail party problem and the algorithm you

play69:52

use to do this is called ICA, Independent Components Analysis.

play69:55

And that's something you implement in one of these later homework exercises, right?

play70:00

Um, and there are other examples of unsupervised learning as well.

play70:04

Uh, the Internet has tons of unlabeled text data.

play70:08

You just suck down data from the Internet.

play70:10

There are no labels necessarily but can you learn interesting things about language,

play70:15

figure out what- figure out on,

play70:16

I don't know, one of the best cited results recently was learning analogies,

play70:21

like yeah, man is to woman as king is to queen, right?

play70:25

Or a- what's a Tokyo is to Japan as Washington DC is to the United States, right?

play70:32

To learn analogies like that.

play70:33

It turns out you can learn analogies like that from unlabeled data,

play70:36

just from texts on the Internet.

play70:37

So that's also unsupervised learning.

play70:39

Okay? Um, so after unsupervised learning,

play70:45

oh, and unsupervised learning.

play70:47

So you know machine learning is very useful today.

play70:50

It turns out that most of the recent wave of

play70:52

economic value created by machine learning is through supervised learning.

play70:56

Uh, but there are important use cases for unsupervised learning as well.

play71:01

So I use them in my work occasionally.

play71:03

Uh, and is also a bleeding edge for a lot of exciting research.

play71:07

And then the final topic.

play71:09

Finally, the five topics we covered.

play71:11

So talk about supervised learning, machine learning strategy,

play71:15

deep learning, unsupervised learning,

play71:16

and then the fifth one is reinforcement learning, is this.

play71:19

Which is, um, let's say, I give you the keys to Stanford autonomous helicopter.

play71:24

This helicopter is actually sitting in my office,

play71:26

and I'm trying to figure out how to get rid of it.

play71:27

Um, and I'll ask you to write a program to- to make it fly, right?

play71:32

So how do you do that?

play71:33

Um, so this is a video of a helicopter flying.

play71:39

The audio is just a lot of helicopter noise. So that's not important.

play71:43

But we'll zoom out the video.

play71:45

You see she's found in the sky, right?

play71:47

There. So, um, you can use learning alg- that's kinda cool, right?

play71:51

[LAUGHTER] I was- I was the camera man that day.

play71:53

Um, but so you can use learning algorithms to get,

play71:56

you know, robots to do pretty interesting things like this.

play72:00

Um, and it turns out that a good way to do this is through reinforcement learning.

play72:05

So what's reinforcement learning?

play72:07

Um, it turns out that no one knows what's the optimal way to fly a helicopter, right?

play72:11

If you fly a helicopter,

play72:12

you have two control sticks that you're moving.

play72:15

Um, but no one knows what's the optimal way to move the control stick.

play72:18

So the way you can get a helicopter fly itself is, um,

play72:22

let the helicopter do whatever- think of this as training a dog, right?

play72:26

You can't teach a dog the optimal way to behave,

play72:29

but- actually, how many of you have had a pet dog or pet cat before?

play72:33

Oh, not that many of you. This is fascinating.

play72:36

Okay. So I had a pet dog when I was a kid

play72:39

and my family made it my job to train the dog. So how do you train a dog?

play72:43

You let the dog do whatever it wants,

play72:45

and then whenever it behaves well,

play72:47

you go, "Oh, good dog".

play72:48

And when it misbehaves you go, "bad dog".

play72:51

[LAUGHTER] Um, and then over time,

play72:53

the dog learns to do more of the good dog things and fewer of the bad dog things,

play72:58

and so reinforcement learning is a bit like that, right?

play73:00

I don't know what's the optimal way to fly a helicopter.

play73:02

So you let the helicopter do whatever it wants and then whenever it flies well, you know,

play73:07

does some maneuver you want, or flies accurately without jetting around too much,

play73:11

you go, "Oh, good helicopter".

play73:13

[LAUGHTER] And when it crashes you go,

play73:15

"bad helicopter" and it's the job of

play73:18

the reinforcement learning algorithms to figure out how to

play73:20

control it over time so as to get more of

play73:23

the good helicopter things and fewer of the bad helicopter things.

play73:26

Um, and I think,

play73:28

um, well, just one more video.

play73:31

Um, oh, yeah, that's interesting. All right.

play73:38

And so again given a robot like this,

play73:41

I actually don't know how to program a- actually

play73:43

a robot like this has a lot of joints, right?

play73:46

So how do you get a robot like this to climb over obstacles?

play73:49

So well, this is actually a robot dog,

play73:52

so you can actually say,

play73:53

"Good dog" or "Bad dog".

play73:54

[LAUGHTER] By giving those signals,

play73:58

called a reward signal, uh,

play73:59

you can have a learning algorithm figure out by itself,

play74:02

how to optimize the reward,

play74:04

and therefore, [LAUGHTER] climb over these types of obstacles.

play74:09

Um, and I think recently,

play74:10

the most famous applications of reinforcement learning happened for game-playing,

play74:14

playing Atari games or playing,

play74:16

you know, Game of Go, like AlphaGo.

play74:18

I think that's a- I think that is a- game playing has made some remarkable stunts a

play74:26

remarkable PR but I'm also equally excited or maybe

play74:29

even more excited about the integrals and reinforcement learning is making

play74:33

into robotics applications, right?

play74:35

So I think, um, I think- yeah,

play74:37

reinforcement learning has been proven to be fantastic at playing

play74:40

games, it's also getting- making real traction

play74:43

in optimizing robots and optimizing sort of logistic system and things like that.

play74:48

Um, so you learned about all these things.

play74:53

Um, last thing for today, uh,

play74:55

I hope that you will start to, to meet people in the class,

play75:00

make friends, find project partners and study groups,

play75:03

and if you have any questions, [NOISE] you know,

play75:05

dive on the Piazza, asking questions as you help others answer their questions.

play75:09

So let's break for today, and I look forward to seeing you on Wednesday.

play75:13

Welcome to 229.

Rate This

5.0 / 5 (0 votes)

Связанные теги
机器学习斯坦福Andrew Ng监督学习深度学习无监督学习强化学习技术创新社会影响学术课程
Вам нужно краткое изложение на английском?