文字记录 · CC BY 4.0

NYU 深度学习第 1 周:历史与演进 — Yann LeCun

本页标题、字幕、摘要和阅读笔记为已保存的 AI 译文,可能有误。时间戳与来源一致,可展开查看原始字幕,并对照原视频核对。

Yann LeCun 在 NYU 深度学习课程开篇中追溯了感知机、梯度下降、卷积架构和分层表征学习。

Alfredo Canziani(冷在) · 发布于 · 1 小时 39 分钟 · 英语 · 许可:CC BY 4.0 · 来源:在 YouTube 上观看

文字记录来源:创作者上传到 YouTube 的字幕。AI 标点由 Vidleaf 添加;原始措辞和时间戳锚点均保留。原始文字记录见下方。

AI 生成的摘要

这节深度学习入门讲座将课程安排与该领域的高层概览结合起来。课程由助教 Alfredo Canziani 和 Mark Goldstein 负责,讲师在周一讲授九次课,周二实践课由 Mark 进一步主持,涵盖实际问题、数学复习和 PyTorch 教程;另有三次客座讲座,预计期中考试可能在三月左右,以及带排行榜的期末项目竞赛,可能以两人一组进行,很可能结合自监督学习和自动驾驶。讲座概述了监督学习、神经网络和深度学习,然后介绍后续主题,包括反向传播和架构组件、卷积网络和循环网络、门控与乘法交互(GRU、LSTM)、记忆网络、Transformer 和适配器、仅简要提及的图神经网络,以及优化技巧。深度学习几乎总是基于梯度的优化,但非凸目标的几何性质尚未被理解;能量模型被提出作为监督、无监督和自监督学习的通用形式,概率模型是其特例,而自监督学习被描述为非常活跃且可能成为主流。历史部分追溯了从 McCulloch 和 Pitts 的阈值单元神经元以及 Hebb 的突触强度思想,经 Wiener 的控制论和 Rosenblatt 的感知机,到 1960 年代末的衰落、1980 年代中期的反向传播复兴,以及 2010 之后的语音、视觉和 NLP 复兴,并指出机器仍然狭窄且缺乏常识。随后对比了两阶段模式识别与端到端深度学习,并解释了为什么全连接矩阵对图像不实用,从而引出卷积和池化。

根据转录内容生成。请对照原始视频检查关联段落。

带时间戳的章节摘要

课程安排与结构

教学人员与联系方式

  • [0:01] 这门课实际上由助教 Alfredo Canziani 和 Mark Goldstein 负责,学生与他们交流的次数会远多于讲师。
  • [0:16] 学生不应在课后提问,因为讲师下课后必须立刻离开去赶飞机。

网站与讲座日程

  • [0:35] 有一个课程网站,讲师会尽力上传幻灯片 PDF,可能就在讲座开始前几分钟。
  • [0:55] 讲师将在周一晚上讲授九次课。

周二实践课

  • [1:01] 每周二晚上有实践课,由 Mark 进一步主持。
  • [1:07] 实践课涵盖实际问题、必要数学和基本概念的复习,以及使用 PyTorch 和各种其他软件工具的教程。

客座讲座与主题

  • [1:24] 将有三场客座讲座,具体人名尚未确定。
  • [1:29] 客座讲座的主题将包括自然语言处理、计算机视觉和自监督学习。

期中考试与期末项目

  • [1:41] 预计会有一次期中考试,可能安排在三月前后的某次课上。
  • [1:53] 考核将基于期中考试和一个期末项目,学生可能被允许两人一组完成。
  • [2:02] 小组是两人还是三人尚未确定。
  • [2:10] 该项目可能涉及自监督学习与自动驾驶的结合,目前正在与各方人士商讨数据事宜。

深度学习课程介绍与先修要求

课程概览与范围

  • [2:23] 第一讲是对深度学习的广泛介绍,包括它是什么、能做什么以及不能做什么。
  • [2:36] 本讲以浅显的方式梳理整门课程的脉络,让学员对所有主题形成宏观的高层认识,以便后续将每个主题放入整体图景中。

机器学习先修要求

  • [2:55] 本课程要求学员熟悉机器学习,或至少掌握基本的机器学习概念。
  • [3:04] 讲师询问有谁用过 PyTorch 或 TensorFlow,或者训练过神经网络。

深度学习课程概览与基础

课程计划与主题顺序

  • [3:25] 讲师不会预设学员了解深层的底层技术,并可根据学员的先前经验调整课程节奏。
  • [3:52] 今天的课程涵盖监督学习、神经网络和深度学习的介绍,包括深度学习能做什么、不能做什么,以及什么是好的特征。
  • [4:05] 下周涵盖反向传播和基本架构组件,如模块、自动微分、损失函数、激活函数、权重共享、乘性交互和注意力门控。
  • [4:35] 将要介绍的宏观架构包括专家混合、孪生网络和超网络。
  • [4:46] 一到两讲(可能包括一场客座讲座)将涵盖卷积网络及其应用。

专用架构:循环、门控与注意力模型

  • [5:06] 将涵盖通过时间反向传播训练的循环神经网络,包括在控制和时间序列生成中的应用。
  • [5:26] 课程涵盖将循环与门控和乘性交互相结合,例如门控循环单元和 LSTM。
  • [5:35] 将讨论基于乘性交互的架构,包括记忆网络、Transformer 和适配器,这些在自然语言处理及其他领域是近期热门话题。
  • [5:51] 图神经网络只会简要涉及,因为 Joan Bruna 的单独课程花了大量时间讲解它们。

优化挑战与实用训练技巧

  • [6:08] 课程将涵盖让深度学习系统奏效的技巧,以及理解神经网络中发生的优化类型。
  • [6:26] 深度学习几乎总是关于基于梯度的优化;凸情形规则已被充分理解,但随机训练以及具有局部极小值和鞍点的非凸代价函数尚未被充分理解。
  • [7:02] 最大的秘密是没有人真正理解目标函数的几何结构,而重要的是要认识到没有人理解这一点。
  • [7:12] 实用技巧源于直觉、一些理论分析和经验搜索:初始化、归一化、如 dropout 的正则化、用于优化的梯度裁剪、动量、平均 HDD,以及并行化 HDD 的方法,其中许多并不奏效。
  • [7:40] 更奇特的方法包括目标传播和反向传播的拉格朗日表述。

基于能量的模型与作为推理的推断

  • [7:47] 基于能量的模型为监督、无监督和自监督学习提供了一种通用表述,包括涉及推断的方法。
  • [8:04] 推断意味着搜索那些没有人告诉你、但系统应当推断出的变量的值,这可以看作是用神经网络实现推理。
  • [8:20] 神经网络中的推理可以视为针对某些变量优化能量函数,所得的值就是所寻求的变量。
  • [8:34] 将神经网络视为从输入计算输出的函数这一常见观点是一种相当受限的推断形式,因为它对给定输入只能产生一个输出。

基于能量的模型与自监督学习

用于多答案的基于能量的模型

  • [8:50] 许多问题对给定输入有多个可能答案,表示这些答案的一种方法是使它们成为能量函数的极小值。
  • [9:04] 推理算法寻找使目标函数最小化的变量值,而多个极小值意味着模型对同一个输入可能产生多个输出。
  • [9:21] 基于能量的模型是实现这一点的一种方式;贝叶斯方法、图模型和贝叶斯网络等概率模型是其中的特例,而能量方法更为通用、不那么具体。
  • [9:39] 特例包括人们过去所说的结构预测,在自监督学习中有许多应用。

自监督学习的兴起

  • [9:52] 自监督学习如今是一个非常活跃的研究课题,未来很可能会真正占据主导地位。
  • [10:02] 在一年之内它就在自然语言处理领域占据了主导地位,而在过去几个月里,有几篇论文表明自监督学习方法在计算机视觉领域也同样效果出色。
  • [10:17] 演讲者猜测,自监督学习将在未来几年内席卷全球。

将示例理解为基于能量的方法

  • [10:31] 示例包括变分自编码器、去噪自编码器以及 BERT,即为自然语言处理训练的 transformer 架构,而自监督学习是去噪自编码器的一个特例。
  • [10:47] 这些方法,包括生成对抗网络(GAN),都可以在基于能量的方法的框架下理解。

迈向猫级与人类级智能

  • [11:04] 机器目前并不具备超级智能或很高的智能:它们能很好地解决非常狭窄的问题,有时甚至达到超越人类的表现,但没有任何机器具备任何形式的常识。
  • [11:12] 最智能的机器所具备的常识可能还不如一只家猫,这就引出了一个问题:如何先达到猫级智能,然后再达到人类级智能。
  • [11:29] 演讲者并不假装自己知道答案,但在自监督学习的背景下有几个值得讨论的想法。

课程作业与期末项目竞赛

作业作为期末项目的准备

  • [11:57] 课程包含作业。
  • [12:29] 这些作业作为练习,帮助熟悉深度学习总体所需的技术,尤其是期末项目所需的技术。

期末项目的形式与排行榜

  • [12:21] 期末项目将是各团队之间的竞赛。
  • [12:26] 竞赛将设有排行榜。

作业也为期中考试做准备

  • [12:46] 这些作业也为期中考试做准备。

神经网络与控制论的起源

受大脑启发但概念上不同

  • [13:03] 深度学习受到关于大脑观察的启发,但这种启发仅是概念上的,并非试图复制大脑。
  • [13:11] 大脑的许多细节无关紧要,而且尚不清楚它们是否真的与人类智能相关。
  • [13:18] 这种类比就像飞机受到鸟类启发:飞行的基本原理基本相同,但细节却截然不同。

麦卡洛克与皮茨的阈值神经元模型

  • [14:17] 这段历史始于1940年代,麦卡洛克和皮茨提出神经元基本上是开或关的阈值单元。
  • [14:39] 通过连接这样的神经元,可以构建布尔电路并用神经元进行逻辑推理,这表明大脑基本上是一台逻辑推理机。
  • [14:56] 神经元计算其输入的加权和,若高于阈值则开启,低于阈值则关闭,这是对真实神经元的一种非常简化的看法。
  • [15:09] 该模型在该领域沿用了近四十年,实际上整整四十年。

赫布学习与维纳的控制论

  • [15:22] 唐纳德·赫布提出大脑通过改变突触强度来学习,当两个神经元同时放电时连接增强,不同时放电时可能减弱。
  • [15:50] 赫布学习不是一种学习算法,但或许是最初的想法。
  • [15:55] 诺伯特·维纳提出了控制论:具有传感器和执行器的系统可以拥有反馈回路并实现自我调节。
  • [16:23] 汽车的转向使用 PID 控制器作为反馈机制,它测量方向盘和车轮的位置,并校正车轮以与之匹配。
  • [16:49] 此类反馈机制的稳定性和规则基本上最初都源自这项工作。

罗森布拉特的感知机硬件

  • [16:57] 弗兰克·罗森布拉特设想了一种学习算法,可以修改非常简单的神经网络的权重。
  • [17:11] 感知机是一台物理模拟计算机,不是三行 Python 程序,而是一台带有电线和低分辨率光学传感器的巨型机器,用于向它展示图片。
  • [17:35] 它的神经元计算加权和,可调节的权重是带马达的电位器,因此它们可以旋转以配合学习算法,使其成为机电式的。
  • [17:45] 图中罗森布拉特手持一个包含八个权重的模块,配有电动电位器。

神经网络研究时间线

  • [18:07] 通过模拟神经元网络来构建智能机器的想法诞生于1940年代,并在1950年代末略有发展。

早期神经网络的衰落与复兴

1960年代末神经网络研究的崩溃

  • [18:19] 神经网络研究在1960年代末彻底消亡,当时人们意识到当时提出的学习算法和架构只能处理基本的、非常简单的模式识别。

日本、1968–1984的孤立研究

  • [18:38] 大约在1968年到1984年之间,世界上基本上没有人研究神经网络,除了少数孤立的研究者,主要在日本。
  • [18:50] 日本被描述为一个相对孤立的研究资助生态系统,人们不追随同样的潮流。

1985年前后的领域复兴

  • [19:04] 该领域大约在1985年再次起飞。

为什么反向传播出现在1980年代中期

连续可微神经元作为前提条件

  • [19:12] 反向传播是一种训练多层神经网络的算法,人们在1960年代就寻求类似的东西,但没有找到。
  • [19:24] 早期的失败源于使用了错误的神经元:二值麦卡洛克-皮茨神经元。
  • [19:32] 反向传播需要一个连续且可微的激活函数,或者至少是连续的,而使用连续神经元的想法缺失了。
  • [19:46] 因为二值神经元不可微,人们认为这样的系统无法用梯度下降训练。

浮点乘法的计算成本

  • [19:56] 使用二值神经元时,不需要乘法:活跃神经元只需将其权重加到加权和中,而不活跃的神经元则不加任何东西。
  • [20:13] 连续神经元需要将神经元的激活值乘以权重来贡献加权和。
  • [20:19] 在1980年代之前,两个数相乘,尤其是浮点数相乘,在任何非极其昂贵的计算机上都非常慢,这产生了避免使用连续神经元的动机。
  • [20:34] 回顾来看,反向传播没有在1980年代中期之前出现,很大程度上是因为那时计算机才变得足够快以进行浮点乘法。

深度学习的复兴及其在应用中的传播

神经网络在1995之后被放弃

  • [20:53] 对神经网络的兴趣浪潮大约持续了从1985到1995,之后机器学习在很大程度上放弃了这一想法。
  • [21:08] 这种放弃一直持续到2000年代末和2010年代初。

语音识别在2010前后的突破

  • [21:10] 大约在2009/2010,人们意识到用反向传播训练的多层神经网络在语音识别上带来了改进。
  • [21:20] 复兴始于2010前后的语音识别,而不是ImageNet。
  • [21:28] 在首批论文发表后的18个月内,语音识别领域的每个主要参与者都部署了使用神经网络的商业系统。
  • [21:38] 2012前后Android手机上的语音识别功能使用了神经网络,这很可能是现代深度学习最早的大规模部署。

计算机视觉在2012–2013的转变

  • [21:55] 在2012末和2013初,计算机视觉界发现深度学习,尤其是卷积网络,比先前的方法效果好得多。
  • [22:08] 该领域转向卷积网络,并在很大程度上放弃了先前技术,在计算机视觉领域引发了第二次革命。

自然语言处理在2015–2016前后

  • [22:12] 大约三年后,在2015/16前后,同样的转变发生在自然语言处理领域,包括语言翻译。

预计将扩展到机器人和控制领域

  • [22:28] 类似的革命尚未发生,但预计会出现在机器人、控制以及其他一系列应用领域。

深度学习中的监督学习和参数调优

监督学习的主导地位与成对训练数据

  • [22:54] 大约90%的深度学习应用以监督学习为主要方法。
  • [23:04] 监督学习收集输入和输出的成对数据,例如带类别的图像、带文本转录的音频片段,或一种语言的文本及其另一种语言的转录。

对错误输出的迭代修正

  • [23:22] 将一个示例输入机器,机器产生一个输出;如果输出正确,就几乎或完全不做什么,但如果输出不正确,就调整机器的参数。
  • [23:39] 调整参数化函数的参数,使输出更接近期望的输出,就像汽车图片没有被标记为汽车时那样。

神经网络权重与反向传播技巧

  • [23:54] 在神经网络中,参数就是那些在模拟神经元中计算加权求和的权重,而旋钮则被调整以使输出更接近目标。
  • [24:07] 神经网络中的关键技巧是确定朝哪个方向以及调整多少旋钮,这正是梯度计算和反向传播所解决的问题。

感知机、Adaline 与特征提取器瓶颈

感知机与 Adaline 作为阈值模型

  • [24:22] 一系列基础分类模型始于感知机及其竞争模型 Adaline。
  • [24:33] 两者基于相同的架构:计算输入的加权和并将其与阈值比较,高于阈值则开启,低于阈值则关闭。
  • [24:45] Bernie Widrow 正在调整的 Adaline 是一台物理模拟计算机,在许多方面比感知机小得多。

感知机的固定关联层

  • [24:59] 感知机是一个两层神经网络,其中只有第二层具有可训练的自适应权重。
  • [25:08] 第一层是固定的,在大多数实验中是随机确定的,以随机权重将输入像素连接到阈值神经元。
  • [25:27] 这第一层被称为关联层,在大约四十年间成为模式识别系统设计的基础。

特征提取器加可训练分类器

  • [25:49] 该模型将输入通过一个特征提取器,旨在提取对任务有用的特征,例如检测眼睛或汽车的深色圆圈。
  • [26:17] 特征提取器产生一个特征向量,可以是数值或开关值,送入可训练分类器,该分类器计算加权和并与阈值比较。
  • [26:41] 问题在于特征提取器必须手工设计。

研究聚焦于手工设计的特征

  • [26:41] 统计模式识别和计算机视觉中面向识别的部分专注于为特定问题设计特征提取器,例如韩文字符识别。
  • [27:12] 工作涵盖了预处理技巧,如归一化图像尺寸、骨架化和从背景中分割字符。
  • [27:18] 文献几乎完全致力于特征提取器,而很少涉及可训练分类器。

深度学习:端到端多层网络

端到端学习取代手工构建的阶段

  • [27:31] 深度学习用端到端学习整个任务,取代了输入表示需要手工设计的两阶段模式识别过程。
  • [27:52] 该系统由级联的模块构成,每个模块都有可调参数和一定的非线性,并堆叠成多层。
  • [28:15] 深度学习中的“深度”一词仅指存在多个层,仅此而已。
  • [28:20] 端到端训练整个堆叠引出了如何调整第一层参数的问题,而反向传播解决了这一问题。

为什么层必须是非线性的

  • [28:39] 模块必须是非线性的,因为两个线性函数的复合本身仍是线性的,所以两个连续的线性层会坍缩成一个。
  • [28:53] 将一个向量先乘以一个矩阵再乘以另一个矩阵,等价于将其乘以这两个矩阵预先计算好的乘积。
  • [29:06] 如果这些层是线性的,那么拥有多个层就没有意义,不过讲者指出有一个次要的理由支持这样做。

最简单的可调非线性架构

  • [29:46] 输入(例如图像或音频)被视为一个向量,并乘以一个矩阵,其系数就是可调参数。
  • [30:15] 所得向量的每个分量都经过一个非线性函数,最简单的选择是 ReLU(x) = max(x, 0)。
  • [30:26] 同一个函数在神经网络中称为 ReLU,在工程中称为半波整流,在数学中称为正部。
  • [30:47] 经过 ReLU 后,凡是加权和小于零的位置,向量中都会包含许多零,然后重复先相乘再非线性化的过程。

为什么它被称为神经网络

  • [31:17] 矩阵乘法的每个输出分量都是输入分量的加权和,使用矩阵中对应的一行作为权重。
  • [31:39] 这种加权求和操作类似于接收输入的单元,这就是该架构被称为神经网络的原因。
  • [31:59] 矩阵乘法后的单元数等于行数,而列数必须等于输入大小。

监督学习与梯度下降

目标函数与训练集平均

  • [32:21] 监督学习将系统对给定输入的输出与目标输出进行比较。
  • [32:33] 目标函数、损失模块或散度计算所产生的输出与目标之间的距离或惩罚。
  • [32:53] 代价函数输出一个标量,例如目标向量与深度学习系统产生的向量之间的欧几里得距离。
  • [33:12] 标量代价是在输入-输出对的训练集上取平均得到的,并且该平均值相对于系统的可调参数被最小化。

梯度下降与凸性

  • [33:55] 最小化通过计算梯度来完成,类似于在夜间迷失于平滑多雾的山中时寻找最陡下降方向。
  • [34:22] 搜索下降方向称为计算梯度,严格来说是负梯度,每一步都沿该方向前进。
  • [34:36] 如果步长足够小,不至于跳到山的另一侧,那么只要谷底是凸的,该过程最终会收敛到谷底。
  • [34:49] 如果没有凸性,像山间湖泊这样的局部最小值可能会困住搜索,即使视野之外存在更低的谷底,这就是凸性重要的原因。

随机梯度:效率与泛化

从小样本批次计算梯度

  • [35:20] 目标函数是许多样本上的平均值,其梯度可以通过对整个训练集取平均来计算。
  • [35:37] 更高效的做法是取一个样本或一小批样本,计算该样本的误差及其相对于参数的梯度,然后迈出一小步。
  • [35:51] 每个新样本都会产生不同的误差和梯度,其方向可能不同,因此路径以带噪声、波动的方式沿代价曲面下降。

两个权重示例中的不规则路径

  • [36:16] 所示示例将随机梯度应用于一个仅有两个权重的简单二维问题。
  • [36:23] 该路径看起来近似周期性,因为示例总是以相同顺序呈现,而这并不是使用随机梯度时应有的做法,路径实际上非常不规则。

更快的收敛与更好的泛化

  • [36:36] 经验上,随机梯度收敛得快得多,尤其是在训练集非常大时。
  • [36:42] 它还往往带来更好的泛化:在单独集合上测得的性能通常优于真正的梯度下降。

全批量梯度下降的代价

  • [37:16] 在整个数据集上计算完整梯度在计算上是可行的,每次计算并不更昂贵,但噪声更少且速度更慢。
  • [37:37] 如果一个百万样本的训练集实际上是10,000样本集的100次重复,那么完整梯度会把相同的值计算一百次,并花费一百倍于必要的工作量。

噪声、冗余与反向传播

由冗余带来的随机梯度效率

  • [38:11] 随机梯度不仅通过重复起作用,在更常规的机器学习场景中同样有效,因为样本中含有大量冗余,许多样本彼此非常相似。
  • [38:25] 只要存在某种一致性,且系统具备泛化能力,随机梯度就更高效,因为不使用随机梯度就无法利用这种冗余。
  • [38:40] 这是噪声对你有利的一个例子。

反向传播:堆叠模块上的链式法则

  • [38:53] 通俗地说,反向传播是链式法则的一种实际应用:神经网络可以看作一堆模块的堆叠,即函数的复合。
  • [39:22] F 与 G 复合的导数,等于 F 在 G(X) 处的导数乘以 G 在 X 处的导数,即两个导数的乘积。
  • [39:37] 当函数是以向量为输入、输出向量的向量函数,或更一般地是多维数组时,同一条法则同样适用。
  • [40:06] 对于具有多个输入和多个输出的功能模块,只要照此应用同一条法则即可,只是必须使用偏导数。

为何称为反向传播

  • [40:20] 要计算目标函数(即期望输出与实际输出之差)对网络内部任意变量的导数,必须将导数反向传播,并在沿途相乘。
  • [40:42] 它被称为反向传播,是因为它适用于多层结构;更正式的论述将在下周给出。

将神经网络扩展到图像输入

图像输入的维度

  • [41:04] 一张图像即使分辨率相对较低,通常每边也有几百个像素。
  • [41:15] 一张 256 x 256 的汽车图像有 65,536 个像素,再加上 R、G、B 三个分量,就得到大约二十万个数值。
  • [41:33] 因此输入向量大约有二十万个分量。

矩阵规模与不切实际性

  • [41:40] 与该向量相乘的矩阵必须有二十万列。
  • [41:54] 取决于第一层的单元数,该矩阵可能是 200,000 x 100,000,规模非常大。
  • [42:06] 即使第一层做了压缩,这样的矩阵也已经包含数十亿个元素。
  • [42:16] 将其视为完整矩阵并不真正可行。

受大脑启发的结构化矩阵

  • [42:23] 处理图像需要对矩阵中的结构进行假设,使其并非完全连接,也不会将所有内容与所有内容相连。
  • [42:33] 完全连接的矩阵将不切实际,至少对许多实际应用而言是如此。
  • [42:35] 这正是从大脑中汲取灵感之处。

视觉系统层级与快速物体识别

休伯尔与维泽尔的视觉皮层记录

  • [42:43] 在经典的1960神经科学工作中,休伯尔与维泽尔将电极插入猫、猴、小鼠等动物的视觉皮层,以确定视觉皮层神经元的功能,这项工作在1970年代获得了诺贝尔奖。

视网膜压缩与脊椎动物盲点

  • [43:27] 所有哺乳动物的视觉系统组织方式相似:光线照射到视网膜上,光感受器前方的几层神经元对信号进行预处理和压缩。
  • [43:44] 人眼大致相当于一台一亿像素的相机,但视神经中若有一亿根纤维,眼睛就会大到无法转动,因此视网膜神经元将信号压缩到每只眼睛约一百万根纤维。
  • [44:26] 讲者称这种布线是脊椎动物进化上的错误:线路位于视网膜前方并穿透视网膜,造成盲点,而鱿鱼和章鱼等无脊椎动物的线路则从后方引出。

外侧膝状体核与腹侧层级

  • [45:33] 信号从眼睛传到大脑底部的外侧膝状体核,该处进行一些对比度归一化。
  • [45:53] 信号从那里传到大脑后部的初级视觉皮层V1,并经过腹侧层级V1、V2、V4和IT,从大脑后部延伸到侧面。
  • [46:11] 在下颞叶皮层中,物体类别得到表征:无论你的祖母穿什么、处于什么位置或被遮挡,神经元都会放电,而在开颅患者中的记录发现了仅对詹妮弗·安妮斯顿有反应的神经元。

物体识别的前馈速度

  • [47:06] 视觉系统似乎以层级化的多层结构执行模式识别,视觉处理被认为基本上是前馈的。
  • [47:19] 识别一个日常物体大约需要100毫秒,这仅够信号以每个神经元几毫秒的延迟从视网膜传到下颞叶皮层。
  • [47:41] 快速识别中没有时间进行循环连接,不过讲者指出这类连接大量存在。

从休伯尔与维泽尔到卷积网络

福岛邦彦的逐层无监督模型

  • [47:58] 福岛邦彦在 1970 年代从 Hubel 和 Wiesel 的研究中获得灵感,构建了一个分层神经网络模型。
  • [49:25] 福岛并没有坚持提取方向特征,而是使用了一种无监督学习算法。
  • [49:39] 他以无监督的方式逐层训练该系统,而非端到端训练。
  • [49:51] 他采用了神经元在视野中复制的做法,以及 Hubel 和 Wiesel 的复杂细胞概念。

V1 中的视网膜拓扑组织与方向选择性

  • [48:14] Hubel 和 Wiesel 发现,单个 V1 神经元只对视野的一小部分作出响应。
  • [48:40] 神经元按视网膜拓扑方式组织,因此相邻神经元响应视野中的相邻区域。
  • [48:48] 覆盖同一区域的神经元群似乎对特定方向的边缘作出响应,相邻神经元则调谐到略微旋转的边缘。
  • [49:18] 因此,V1 被描绘为具有方向选择性,调谐到多个方向的神经元群在整个视野中复制。

复杂细胞与平移不变性

  • [50:00] 复杂细胞汇聚简单细胞的活动,而简单细胞是方向选择性单元。
  • [50:15] 当有方向的边缘轻微移动时,不同的简单细胞被激活,但复杂细胞会保持激活,直到边缘离开其感受野。
  • [50:32] 因此,复杂细胞在表征中引入了一点平移不变性。
  • [50:44] 这些机制在卷积网络中现在被称为卷积和池化。

卷积网络:局部连接与权重共享

  • [50:54] 这一系列工作促成了 1980 年代中后期的卷积网络。
  • [51:00] 卷积网络具有在视野中复制的局部连接,将特征检测层与池化操作交错排列。
  • [51:34] 层中的每个神经元对输入的一小块区域计算加权和,并且该层中的每个神经元使用同一组权重。
  • [51:50] 这就是权重绑定或权重共享的思想,而反向传播使这类网络能够被训练来识别模式。

早期用于字符识别的端到端神经网络 a

贝尔实验室在 386 PC 上的手写数字演示

  • [52:02] 演讲者展示了一个来自 1980 年代末或 1990 年代初的手写数字演示,同时还有他大约三十岁时的照片以及他旧的新泽西贝尔实验室电话号码,该号码已不再使用。
  • [52:21] 按下按键会在配备特殊加速卡的 386 PC 上运行神经网络,类似于之前展示的动画网络,它能识别任何风格的字符,包括非常奇怪的字符。
  • [52:51] 这在当时是全新的,因为模式识别仍遵循先提取特征、再在其上训练分类器的模式,而该系统从数据中端到端地学习整个任务。
  • [53:08] 前几层充当特征提取器,但却是从数据中训练出来的;选择字符识别是因为它和语音识别是仅有的拥有足够数据的任务,而语音实验只取得了部分成功。

用于同时分割和识别的卷积网络

  • [53:29] 网络的卷积特性使它们能够一次识别成组的字符,而不仅仅是单个字符,方法是将其应用于大图像,并在其视野中出现可识别形状时激活。
  • [54:02] 一个带有小输入窗口的卷积网络在整个图像上滑动,每当它激活时,就表示它检测到了被训练检测的对象。
  • [54:15] 该系统执行同时分割和识别,不同于早期的模式识别程序,后者在将每个字符发送给识别器之前,会显式地将对象与背景以及彼此分开。

用于人脸和行人的滑动窗口检测

  • [54:42] 同样的方法适用于自然图像,例如人脸和行人检测:在数千个样本上训练卷积网络以区分有脸和无脸的图像,然后在图像上滑动窗口。
  • [55:02] 因为人脸可能比窗口大,所以对图像进行子采样使其变小,并反复滑动网络,从而可以检测任意大小的人脸。

用于机器人导航的卷积障碍物检测

  • [55:19] 在深度学习流行之前,卷积网络被应用于运行中机器人的摄像头图像,对每个小窗口(约 40x40 像素或更小)按其中心像素位于地面还是障碍物进行分类。
  • [55:48] 地面标记为绿色,障碍物标记为红色或紫色,并将其映射到俯视地图中,用于规划通往目标的路径并进行导航。
  • [56:09] 图中展示了前博士生 Raia Hadsell 和 Pierre Sermanet 正在测试机器人;Sermanet 是加利福尼亚 Google Brain 的研究科学家,从事机器人研究,Hadsell 是机器人研究负责人。

语义分割与 Mobileye 的采用

滑动窗口语义分割

  • [56:45] 语义分割可以采用滑动窗口方法,其中卷积网络以窗口为上下文对中心像素进行分类。
  • [56:58] 与障碍物检测不同,该网络被训练用于对大约 30 个类别进行分类,例如道路、行人、植物和树木。
  • [57:18] 该系统错误地在华盛顿广场公园中央识别出沙漠,因此并不完美,尽管在当时它是该任务的最先进水平。

在 2010 前后宣传深度学习

  • [57:36] 大约在 2010 年,深度学习革命之前,演讲者通过演讲向人们宣传深度学习。
  • [57:48] 一位来自以色列的理论教授参加了其中一场演讲,并被其潜在应用深深吸引。

Mobileye 转向卷积网络

  • [58:03] 这位教授即将在 Mobileye 休学术假,当时 Mobileye 是一家以色列自动驾驶初创公司。
  • [58:15] 他敦促 Mobileye 尝试卷积网络,但工程师们拒绝了这一想法,坚持使用他们自己的方法。
  • [58:26] 他自己实现了该方法,并击败了他们所有的基准,此后整个公司都转向了卷积网络。

首个汽车视觉系统

  • [58:36] Mobileye 是第一家为汽车生产视觉系统的公司,该系统能让汽车保持在高速公路车道上,并为穿越的行人或骑行者刹车。
  • [58:54] 该系统使用了与机器人所示非常相似的语义分割。
  • [58:59] 这位教授是 Shai Shalev-Schwartz。

神经网络硬件与深度学习复兴

1980 在贝尔实验室的神经网络芯片工作

  • [59:08] 在 1980 年代,人们对能够非常快速地运行神经网络的特殊硬件有着浓厚的兴趣。
  • [59:16] 新泽西贝尔实验室演讲者团队中的人员实现了几款神经网络芯片,演讲者参与了其中一些工作。
  • [59:28] 对神经网络的兴趣在 1990 年代中期消退,因此此类硬件的工作一直停止,直到几年前才恢复。

与 Bengio 和 Hinton 的协同努力

  • [59:08] 在 2000 年代初,演讲者、Yoshua Bengio 和 Geoff Hinton 知道深度学习运行良好,并且社区错误地摒弃了神经网络和深度学习。
  • [59:08] “深度学习”一词当时尚未使用,是在几年后发明的;大约在 2003 或 2004 年,该团队开始了演讲者所称的“阴谋”。
  • [59:08] 他们着手在数据集上打破记录,发明用于训练超大型神经网络的算法,并收集超大型数据集向世界证明这些方法确实有效,因为当时没有人真正相信。

神经网络加速器成为当今热门芯片话题

  • [59:39] 神经网络加速器现在是芯片行业中芯片设计最热门的话题。
  • [59:52] 在 ISSCC 等计算机体系结构和固态电路会议上,大约一半的报告涉及神经网络加速器。
  • [1:00:03] 演讲者研究过几个神经网络加速器。

从 2010 开始的突破

  • [1:00:09] 大约在 2010、2013 和 2015 年前后,语音识别、图像识别和自然语言处理取得了进展,并且还在其他主题上继续推进。
  • [1:00:23] 演讲者遗憾地指出,这一突破并非发生在他自己的实验室,而是与朋友们一起实现的。

AlexNet 与计算机视觉领域的深度学习突破

基于 GPU 的卷积网络与 ImageNet 设置

  • [1:01:18] Geoff Hinton 的学生 Alex Krizhevsky 花了大量时间在 GPU 上实现卷积网络,当时 GPU 正变得高性能。
  • [1:01:36] 这让他们能够训练出比以往任何人都大得多的卷积网络。
  • [1:01:48] 他们在自然照片的 ImageNet 数据集上进行训练,系统必须在 1,000 个类别中识别主要物体,训练样本有 1.3 百万个。
  • [1:02:09] 他们基本沿用之前的相同模型构建了一个非常大、非常深的卷积网络,在 GPU 上运行了几周,并以很大优势击败了最好的竞争系统。

ImageNet 错误率进展与转折点

  • [1:02:27] 在 top-5 错误率指标上,2010 年的 ImageNet 错误率约为 28%,2011 年为 25.8%,其中 2011 年的系统非常大,且只训练了最后一层。
  • [1:03:04] Hinton 的团队将错误率降至 16.4%,这对计算机视觉界是一个转折点。
  • [1:03:18] 学术界从 2011–2012 年几乎拒绝所有涉及神经网络的论文,转变为 2016 年拒绝没有卷积网络的论文。

successive 架构中的层数膨胀

  • [1:03:50] 随着架构技巧使错误率迅速下降,层数不断膨胀:1990 年代的卷积网络大约有 7 层。
  • [1:04:03] AlexNet 大约有 12 层,次年的 VGG 有 19 层,而 GoogLeNet 的层数难以确定。
  • [1:04:18] 当前物体识别的标准骨干网络 ResNet-50 有 50 层,而有些网络大约有 100 层。

ImageNet 准确率与计算量和内存占用的权衡

网络对比图的坐标轴

  • [1:04:35] 图中的每个色块代表一种特定的网络架构。
  • [1:04:41] 横轴表示计算输出所需的十亿次运算量。
  • [1:04:50] 纵轴是 ImageNet 上的 top-one 准确率,这与之前展示的性能指标不同。
  • [1:05:01] 每个色块的大小代表内存占用,以存储权重值所需的百万个浮点数来衡量。

压缩与优化的动机

  • [1:04:57] 目前在该准确率指标上,最好的系统大约达到 84。
  • [1:05:12] 人们会压缩这些网络,例如通过量化,而 Google、Facebook 等地的整个团队专门致力于优化和压缩它们,以便它们能快速运行。
  • [1:05:37] 例如,Facebook 每天在其服务器上运行卷积网络数百亿次,这产生了巨大的动力去优化所需的计算。

组合性作为深度学习的基础

自然数据中的组合层次结构

  • [1:06:01] 卷积网络之所以成功,是因为它们利用了组合性,这是自然数据的一种属性。
  • [1:06:16] 场景由物体组成,物体由部件组成,部件由子部件组成,子部件由基元组成,基元由轮廓、边缘或纹理组成,而这些又是像素的组合。
  • [1:06:40] 在这种组合层次结构中,某一层物体的特定组合构成了下一层的物体。

在网络架构中模仿层次结构

  • [1:06:48] 深度学习在网络架构中模仿这种组合层次结构,并让网络学习某一层中形成下一层特征的适当特征组合。
  • [1:07:06] 深度学习是关于学习如何表示世界并利用其结构,即由于世界具有组合性而存在的组织方式。

Stuart Geman 对爱因斯坦名言的改写

  • [1:07:19] 布朗大学的 Stuart Geman 对爱因斯坦的名言进行了发挥:世界最不可理解之处在于它是可以理解的。
  • [1:07:35] 爱因斯坦的观点是,世界可能复杂到我们无法理解,因此我们至少能理解其中一部分,这看起来像是一个阴谋。
  • [1:07:47] Geman 的版本是:世界具有组合性,或者存在上帝,因为如果世界不具有组合性,就需要超自然的东西才能理解它。

计算机视觉中深度学习的进展

深度学习实现的计算机视觉能力

  • [1:08:06] 深度学习推动了计算机视觉的显著进步,从不可靠的人体检测到精确的逐对象掩码、姿态估计以及在移动平台上的实时运行。
  • [1:08:25] 这些进步大多基于两个基本的架构系列。

两个主导的架构系列

  • [1:08:34] 一个系列是单遍对象检测/识别架构,如 RetinaNet 和特征金字塔网络,或 U-Net。
  • [1:08:43] 另一个系列是 Mark-RCNN;两个系列都起源于现在在 Facebook 的人,有时是在他们加入之前。
  • [1:08:59] 这些架构效果很好,能检测部分遮挡的对象并为每个对象绘制掩码。

图像输入、图像输出掩码预测

  • [1:09:05] 该模型是一个卷积神经网络,其输入是一张图像,输出也是一组图像,每个类别一张。
  • [1:09:13] 对于每个类别,它输出属于该类别的对象的掩码。

单个对象的实例分割

  • [1:09:23] 这些模型可以执行实例分割:给定许多羊,它们能区分并挑出单个羊,而不是仅将区域标记为羊。
  • [1:09:31] 该模型可以数羊,演讲者开玩笑说这就是你入睡时做的事。

深度学习中的开放研究文化

  • [1:09:50] 许多深度学习社区已经接受了公开进行研究。
  • [1:10:01] 课堂上讨论的工作不仅发表,还附带代码发表,并且通常附带可以下载和运行的预训练模型。
  • [1:10:13] 一切都是开源的且免费使用,这真的很新,因为人们,特别是在工业界甚至学术界,过去不会以这种方式分发他们的代码。

自动驾驶中的卷积网络

Mobileye 早期的卷积网络部署

  • [1:10:38] Mobileye 是自动驾驶中卷积网络的早期用户,如 Mobileye 视频所示。
  • [1:10:47] 到 2015 年,Mobileye 已成功将卷积网络集成到其为另一目的设计的芯片上。
  • [1:10:52] Mobileye 将该技术授权给了特斯拉,特斯拉首批驾驶辅助车辆正是利用这套 Mobileye 系统在高速公路上保持车道并实现变道。
  • [1:11:05] 该卷积网络运行在后视镜后方的一小块芯片上,通过车窗向外观察。

广泛部署与市场地位

  • [1:11:18] 此后四五年间,这项技术已被众多不同公司广泛部署。
  • [1:11:26] Mobileye 被英特尔收购,在这些视觉系统市场中占据约 70 或 80 的份额。
  • [1:11:35] 许多公司和汽车制造商都在使用这些系统。

欧洲强制要求紧急制动

  • [1:11:41] 在一些欧洲国家,出厂的每一辆车,即便是低端车,都配备了基于卷积网络的视觉系统,用于高级或自动紧急制动(AEBS)。
  • [1:11:58] 例如,法国的每一辆车都部署了 AEBS,它能将碰撞减少 40%。
  • [1:12:04] 并非路上每辆车都已配备,因为人们会长期持有车辆,但这意味着它能挽救生命。

深度学习在医学影像中的应用

3D 卷积网络用于 MRI 分析

  • [1:12:21] 医学影像是深度学习应用的另一个主要类别,被称为当今放射学中最热门的课题。
  • [1:12:34] 纽约大学同事的一篇论文幻灯片展示了使用 AI(即卷积网络)对 MRI 图像进行分析。
  • [1:12:41] 卷积网络的一个关键优势是,它们无需查看屏幕就能检查 MRI。
  • [1:12:53] 它们不必将 MRI 切成 2D 图像,而是可以直接查看整个 3D 体数据。
  • [1:13:01] 3D 卷积网络查看整个 MRI 体数据,并使用类似语义分割的技术,在输出图像中只要存在股骨等结构的位置就将其激活。
  • [1:13:25] 这种方法在 3D 中比在 2D 切片中效果更好。

乳腺钼靶中的肿瘤检测及其他项目

  • [1:13:31] 当网络在乳腺钼靶(属于 2D 而非 3D)中检测到恶性肿瘤时,就会将其激活。
  • [1:13:37] 医学影像领域的各种其他项目也正在进行中。

跨科学与物理学的应用

  • [1:13:47] 科学、物理学、生物信息学等领域有许多应用,演讲者表示稍后会再次讨论这些应用。

深度学习的奥秘

缺乏完整的理论

  • [1:14:00] 深度学习仍存在奥秘:人们已有一些理解,但还没有一个能涵盖一切的良好理论,包括这些方法为何效果如此之好。

为何需要超过两层

  • [1:14:16] 理论家很早以前就论证过,任何函数都可以仅用两层来近似,因此他们质疑为何还需要更多层。

卷积网络的特别之处

  • [1:14:29] 卷积网络利用了自然图像以及语音等其他自然信号的组合性,不过演讲者承认这一解释似乎有些牵强。

在非凸目标下仍能训练

  • [1:14:45] 尽管所最小化的目标函数高度非凸且可能有许多局部极小值,训练为何仍能成功,目前仍不清楚。
  • [1:14:52] 从未实验过神经网络的批评者反对说,无法保证算法会收敛,这使得该方法令人望而生畏、不敢使用。

过参数化与统计学建议

  • [1:15:10] 神经网络训练似乎打破了统计学教科书的规则:有 n 个数据点时,参数不应超过 n 个,否则会严重过拟合。
  • [1:15:41] 神经网络经常以数亿个参数被训练并部署到生产环境中,远超训练样本数量,却依然有效。

深度学习当前的能力与局限

当今深度学习的实际应用

  • [1:15:59] 如今的深度学习使更安全的汽车、更好的医学图像分析系统以及虽远非完美但很有用的语言翻译成为可能。
  • [1:16:13] 当前的应用还包括演讲者所称的愚蠢聊天机器人,以及非常出色的信息搜索、检索和过滤。
  • [1:16:19] 谷歌和脸书完全围绕深度学习构建,没有它就会崩溃。
  • [1:16:28] 深度学习在能源管理与生产、制造业以及环境保护方面也有许多应用。

智能机器仍然缺少什么

  • [1:16:34] 我们还没有真正智能的机器,也没有具备常识的机器。
  • [1:16:39] 我们也缺乏智能个人助理、智能聊天机器人和家用机器人。
  • [1:16:45] 有许多事情我们不知道如何去做,这正是研究仍在继续的原因。

深度学习与学习到的表示

什么是表示

  • [1:16:51] 深度学习的根本在于学习表示。
  • [1:17:09] 表示将原始数据转换为一种有用的形式,理想情况下这种有用性应具有通用性,而不论具体任务如何,尽管这一概念并不完全清晰。
  • [1:17:28] 至少,表示应当对你所设想的任务有用。

随机投影与感知机

  • [1:17:44] 几十年来,人们提出了许多对自然数据进行通用预处理以产生良好表示的想法,例如统计空间和随机投影。
  • [1:18:06] 随机投影大约每五年就会重新出现一次,每次都必须被否定。
  • [1:18:15] 感知机的第一层就是一层随机投影。
  • [1:18:21] 随机投影是一个输出维度小于输入维度的随机矩阵,随后接上某种非线性,就像具有随机权重的单层神经网络。

极限学习机

  • [1:18:43] 人们会周期性地重新发现随机投影,声称它们很棒,因为不需要多层训练。
  • [1:18:50] 这一想法始于感知机,并在60年代、1980年代以及现在再次回归。
  • [1:18:59] 一个主要位于亚洲的群体将第一层为随机的两层神经网络称为“极限学习机”,演讲者觉得这很荒谬,但指出它确实存在。

深度学习的层次结构与批评

跨模态的组合层次结构

  • [1:19:27] 世界是组合性的:在视觉中,信息从像素到边缘到纹理基元、图案、部件和物体。
  • [1:19:30] 文本遵循类似的层次结构,从字符到单词、词组、从句、句子和故事。
  • [1:19:38] 语音同样具有层次结构,从单个采样到频带、声音、音素、音位和单词。

对深度学习的反复否定

  • [1:19:52] 人们曾多次试图否定深度学习的整体理念,这些论点已经流传了几十年,主要来自理论家。
  • [1:20:01] 这些否定论调很可能在五年后卷土重来,届时人们会说深度学习不行了。
  • [1:20:10] 一个反复出现的否定论调是:为什么不改用支持向量机呢?

核机器与两层网络

作为固定首层网络的支持向量机

  • [1:20:55] 支持向量机可以被视为一个两层神经网络,尽管人们不喜欢这样表述。
  • [1:21:06] 在第一层中,每个单元使用函数K将输入向量X与一个训练样本X^i进行比较。
  • [1:21:26] 典型的K计算X与X^i的点积,然后通过负平方的指数函数,得到作为距离函数的高斯响应。
  • [1:21:54] K的得分通过加权求和进行组合,学习到的参数是权重,即alpha值。
  • [1:21:59] 第二层是可训练的,而第一层是固定的,不过第一层可以看作是无监督训练的,因为它只使用X,而不使用Y。

美其名曰的模板匹配及其代价

  • [1:22:14] 第一层以最简单的方式使用数据:它存储每个X,并将每个X用作一个神经元的权重。
  • [1:22:44] 该方法基本上就是美其名曰的模板匹配,因为它将输入向量与所有训练样本进行比较。
  • [1:22:54] 对于使用原始图像的计算机视觉来说,效果不佳:对于一百万张ImageNet图像,每张图像必须与一百万张图像进行比较,这非常昂贵。
  • [1:23:19] 比较本身基本上解决了问题,而最终的加权求和只是锦上添花。

通用逼近与理论家的反对意见

  • [1:23:29] 定理表明,通过调整K函数和alpha值,可以任意逼近任何函数。
  • [1:23:39] 因此,理论家可能会问,既然核机器可以逼近任何函数,为什么还需要深度学习。
  • [1:23:50] 然而,求和中的项数可能非常大,而且没有人指定使用哪个核函数,所以这并没有解决问题。

两层神经网络与深度的代价

  • [1:24:01] 在两层神经网络中,第一层对矩阵W^0与输入向量的乘积应用非线性函数F,第二层乘以第二个矩阵,并将结果通过另一个非线性函数。
  • [1:24:16] 在某些条件下,只要中间向量足够大,这种两个线性与非线性操作的组合可以逼近任何函数。
  • [1:24:31] 如果第一层输出的维度足够高——甚至可能是无限的——那么只要让这一层趋于无限,任何函数都能被逼近到任意精度。
  • [1:24:43] 理论家可能会问,既然两层就能逼近任何函数,为什么还需要更多层?但反驳的观点是,用两层来实现可能代价极其高昂。

逻辑电路与两层布尔函数

  • [1:25:09] 在逻辑电路设计中,一切都可以仅用与非门来实现。
  • [1:25:25] 任何布尔函数都可以写成一堆与运算,再在顶层接一个或运算,这称为析取范式(DNF)。
  • [1:25:36] 因此任何布尔函数都可以用两层来表示。

电路深度与规模的权衡

浅层电路的指数级宽度

  • [1:25:40] 对大多数函数而言,中间层所需的项数随输入规模呈指数增长。
  • [1:25:48] 对于 N 个输入位的奇偶校验,两层电路本质上需要指数数量的门。
  • [1:26:12] 若允许 log(N) 层(N 为输入位数),复杂度可降至线性。

两步程序的类比

  • [1:26:28] 两层电路就像被限制为两个顺序步骤的程序,其中大部分指令并行执行。
  • [1:26:54] 可用的指令是诸如线性组合和非线性之类的简单操作,而不是完整的子程序。
  • [1:27:10] 对大多数问题而言,第一步计算出的中间值数量随输入规模呈指数增长,只有极少数问题能避免指数数量的最小项。

顺序步骤以速度换取资源

  • [1:27:25] 允许多个顺序步骤可以让程序简单得多,但运行更慢,同时占用少得多的内存和资源。
  • [1:27:49] 一个简单的顺序二进制加法器逐对相加各位并传播进位,耗时与数字的规模成正比。

超前进位与深度-面积权衡

  • [1:28:13] 电路设计者使用超前进位来预先计算进位,因此加法所需的步骤远少于 N 步。
  • [1:28:21] 超前进位的代价是电路复杂度及其在芯片上所占面积的大幅增加。
  • [1:28:35] 这说明了已知的时间与空间之间、或深度与时间之间的交换关系。

定义深度学习模型中的深度

判定模型为深度的标准

  • [1:28:46] 一个带有一个隐藏层的两层神经网络不被认为是“深度”的,尽管它在技术上使用了反向传播。
  • [1:28:52] 这种浅层网络并不能真正学习复杂的表示。
  • [1:29:01] 深度学习涉及层次结构的思想,而支持向量机显然不是深度的。

流形假设与特征表示

自然图像作为像素空间的一小部分子集

  • [1:29:20] 流形假设认为,自然数据位于高维环境空间内的低维曲面上。
  • [1:29:32] 一幅 1,000 x 1,000 像素的彩色图像是一个具有 3 百万个分量的向量,但只有此类向量的一小部分子集对应于自然图像。
  • [1:30:14] 将随机像素组合成无意义图像的方式,远多于组合成看起来自然的图像的方式。

人脸图像流形的维度

  • [1:30:43] 对于一段人在白色背景前做表情、头发不动的长视频,所有图像的集合位于一个低维曲面上。
  • [1:33:31] 人物所占的像素数量是该曲面维度的一个宽松上界,因为这些像素并不会取所有可能的值。
  • [1:33:58] 该维度受限于面部可独立运动的肌肉数量,约为 50 且少于 100,不包括舌头。
  • [1:34:14] 头部倾斜和平移大约增加了 6 个自由度,因此局部上该曲面尽管高度非线性,其参数少于 100 个。

理想的特征提取与解耦

  • [1:35:35] 理想的特征提取器会解耦观测数据中可解释的变化因素。
  • [1:35:45] 每个独立因素,例如移动面部肌肉、移动头部或摘下眼镜,都是一个单独的变化因素。

表示学习与变化因素解耦

分离独立变化因素的目标

  • [1:35:53] 光照是另一个可以变化的可变因素示例。
  • [1:36:00] 理想的表示会单独表示这些变化因素中的每一个。
  • [1:36:06] 学习良好表征的一个标准是找到数据中独立的可解释变异因素。

未解决的挑战与最终目标

  • [1:36:18] 底线是,没有人知道如何做到这一点。
  • [1:36:23] 这仍然是表征学习的最终目标。
  • [1:36:32] 演讲者表示,讲座基本上已经接近尾声。

PCA 对非线性人脸流形的局限性

PCA 仅适用于线性流形

  • [1:36:52] 只有当流形是线性的,即所有示例或人脸占据的表面是一个平面时,PCA 才能找到相关的向量。
  • [1:37:11] 在这种线性假设下,PCA 会找到该平面的维度。
  • [1:37:18] 在实践中,流形并不是线性的。

接近但不同的人脸流形

  • [1:37:29] 演讲者和他长得很像的大儿子在同一位置做同样表情的图像相对接近,尽管他们不是同一个人。
  • [1:37:41] 演讲者的脸平移 20 个像素后,与他自己的脸的距离比与他儿子的脸的距离更远。
  • [1:37:58] 演讲者的脸位于一个复杂的流形上,而他儿子的脸位于一个略有不同且不相交的流形上。
  • [1:38:06] 这两个流形彼此之间的距离比任一流形内任意两个样本之间的距离更近,因此 PCA 基本上不会告诉你任何有用的信息。

头部旋转作为圆形流形

  • [1:38:20] 表面不是平面的第二个原因是演讲者将头部旋转整整 360 度所形成的一维流形。
  • [1:38:38] 该流形在拓扑上等同于一个圆,因此它不是平坦的,无法对齐,PCA 也无法找到它。

读取带时间戳的可用字幕,或转录播客、讲座和本地音频/视频。免费 YouTube 转录提取器。

需要提取其他公开视频的 SRT、TXT 或 Markdown 字幕?前往 YouTube 字幕提取工具。

前 3 段双语对照预览 · 免消耗额度

以下展示前 3 段已保存中文译文与英文原版字幕的逐段对照(零额度消耗):

[0:00]

好的,首先,我得做一个糟糕的坦白。这门课实际上不是我教的,而是由这两位:Alfredo Canziani 和 Mark Goldstein 教的,他们的名字在这里[指向幻灯片]。他们是助教,你们与他们交流的次数会远多于与我交流。这是第一件事。另一个坦白是,如果你对这门课有疑问,不要在课程结束时提问,因为我下课后得赶飞机。但可以等到下周。好的,那我们直接开始吧。

OK, so first of all, I have a terrible confession to make. This class is actually being run not by me, but by these two guys: Alfredo Canziani and Mark Goldstein, whose names are here [points to slide]. They are the TA'S and you'll talk to them much more often than you'll talk to me. That's the first thing. The other confession I have to make is that if you have questions about this class, don't ask them at the end of this course because I have to run right after the class to catch an airplane. But that can wait until next week. OK, so let's start right in.

[0:35]

一些非常基础的课程信息。如你所见,有一个网站。我会尽力把幻灯片的 PDF 放到网站上。通常可能就在讲座前,可能就在讲座开始前几分钟。但是,到你上课的时候,或者至少到我上课的时候,它应该已经在那里了。我将在周一晚上讲授九次课。每周二晚上还有一节实践课,后续由 Mark 来主持。所以,他们会讲解一些实践问题。一些关于数学的复习内容,也就是本课程所需的数学知识,以及基本概念。还有一些关于如何使用 PyTorch 和其他各种软件工具的教程。

Some very basic course information. There is a website as you can see. I will do what I can to post the PDF of the slides on the website. Probably just before the lecture, probably just a few minutes before the lecture, usually. But, but it should be there by the time you get to class, or at least by the time I get to class. There's going to be nine lectures that I'm going to teach, on Monday evenings. There is also a practical session every Tuesday night that further on Mark will be running. So, they'll go through some of the, you know, practical questions. Some, you know, refreshers on sort of math, you know mathematics that are necessary for this, and basic concepts. Some tutorials on how to use PyTorch and various other software tools.

[1:24]

还会有三场客座讲座。客座讲座的人选尚未最终确定。但主题会涉及自然语言处理、计算机视觉、自监督学习之类的内容。会有一次期中考试,至少我们认为会有。它会占用其中一次课的时间,大概在三月左右。评估将基于期中考试和期末项目。

And there's going to be three guest lectures. The names of the guest lectures are not finalized. But it's gonna be on topics like natural language processing, computer vision, self-supervised learning, things like that. There's going to be a midterm exam, or at least we think there is. And it's going to take one of those sessions, you know, around March. And the evaluation will be done on the midterm and on a final project.

[0:00] 好的,首先,我得做一个糟糕的坦白。这门课实际上不是我教的,而是由这两位:Alfredo Canziani 和 Mark Goldstein 教的,他们的名字在这里[指向幻灯片]。他们是助教,你们与他们交流的次数会远多于与我交流。这是第一件事。另一个坦白是,如果你对这门课有疑问,不要在课程结束时提问,因为我下课后得赶飞机。但可以等到下周。好的,那我们直接开始吧。

[0:35] 一些非常基础的课程信息。如你所见,有一个网站。我会尽力把幻灯片的 PDF 放到网站上。通常可能就在讲座前,可能就在讲座开始前几分钟。但是,到你上课的时候,或者至少到我上课的时候,它应该已经在那里了。我将在周一晚上讲授九次课。每周二晚上还有一节实践课,后续由 Mark 来主持。所以,他们会讲解一些实践问题。一些关于数学的复习内容,也就是本课程所需的数学知识,以及基本概念。还有一些关于如何使用 PyTorch 和其他各种软件工具的教程。

[1:24] 还会有三场客座讲座。客座讲座的人选尚未最终确定。但主题会涉及自然语言处理、计算机视觉、自监督学习之类的内容。会有一次期中考试,至少我们认为会有。它会占用其中一次课的时间,大概在三月左右。评估将基于期中考试和期末项目。

[1:58] 而且,你们可以,你知道的,两人一组。我们说的是两人还是三人,还是就两人?我们还没决定,到时候再看。项目大概会结合自监督学习和自动驾驶。我们正在和各方讨论数据之类的事情。好,让我稍微讲一下,这第一讲实际上将是一个宽泛的介绍,讲深度学习到底是什么,它能做什么,不能做什么。

[2:33] 所以它将作为整个课程的导论。因此,我们会走一遍整门课的脉络,如果你愿意这么说的话,但会以非常浅显的方式,让你对我们所讲的所有主题有一个宽泛的高层概念。而每当我讲到某个具体主题时,你都会看到它在这幅整体图景中的位置。但在此之前……这门课有一个先修要求,就是:你需要熟悉机器学习,或者至少了解机器学习的基本概念。

[3:04] 在座的有谁用过 PyTorch、TensorFlow,训练过神经网络?好。有谁没做过?别害羞,好吗?好吗?所以大多数人都做过。这很好。但我不会假设你们对这些东西全都了如指掌。尤其是,我不会假设你们了解很多那些深层的底层技术。好,这是课程计划,根据你们告诉我的情况,我可以调整它,在某些你们觉得太简单、因为之前已经玩过的部分讲快一点,或者其他部分。

[3:52] 那么,监督学习、神经网络、深度学习导论。这就是我今天要讲的内容。深度学习能做什么,不能做什么,什么是好的特征。深度学习是关于学习表征的。这就是我要讲的。下周会讲反向传播和基本的架构组件。比如,你用模块搭建神经网络,再把它们连接起来。然后你计算梯度,就得到自动微分。然后是各种类型的架构、损失函数、激活函数——你知道,不同的模块。还有权重共享和权重绑定、乘性交互、注意力门控之类的技巧,对吧。

[4:33] 然后是特定的宏观架构,比如专家混合、孪生网络、超网络等等。所以我们会很快深入进去,如果你们已经玩过其中一些东西,这样是合适的。然后会有一到两讲——我还没完全决定——关于卷积网络及其应用。其中一讲可能最终会是客座讲座。然后,更具体地,关于在特殊情况下有用的深度学习架构。

[5:06] 比如带时间反向传播的循环神经网络,这是训练循环神经网络的方式。还有……以及……循环神经网络在控制、生成时间序列之类事情上的应用。然后是结合循环、门控和乘性交互的东西,比如门控循环单元和 LSTM。然后是以乘性交互作为其架构真正基础的东西,比如记忆网络、Transformer、适配器等等,这些是最近非常流行、在自然语言处理和其他领域变得极其流行的架构。然后稍微讲一点图神经网络,这个我不会讲太多,因为还有另一门课,由 Joan Bruna 讲授,他在图神经网络上花了很多时间。

[6:06] 然后……然后我们会讨论如何让这些深度学习系统运作起来。以及让它们运作的各种技巧。大致理解神经网络中发生的优化类型。所以…………那种……你知道,我们……我们当然会用到——学习总是,几乎总是关于优化的。而深度学习几乎总是关于基于梯度的优化。在凸情形下,关于优化有一些规则是已被充分理解的。

[6:40] 但当训练是随机的时候,这些规则就不那么被充分理解了,而大多数深度学习系统正是这种情况。而且在深度学习中它们也不太被充分理解,因为代价函数不是……不是凸的。它有局部极小值、鞍点之类的东西。所以理解目标函数的几何结构很重要。我说理解很重要,但这里最大的秘密是其实没人真正理解。所以……重要的是要明白没人理解。明白吗?但有一些技巧是通过直觉、一点理论分析和经验搜索的结合而出现的。比如初始化技巧、归一化技巧,以及像 dropout 这样的正则化技巧。

[7:29](梯度裁剪更多是为了优化。)比如动量、平均 HDD、并行化 HDD 的各种方法。其中很多并不奏效。然后是一些稍微奇特的东西,叫做目标传播和反向传播的拉格朗日表述。然后我会转向我最喜欢的话题,即基于能量的模型。所以这算是对许多不同学习方法的某种一般性表述——无论它们是有监督、无监督还是自监督。也无论它们是否涉及推断之类的东西。

[8:04] 比如,你知道,搜索那些没人告诉你取值、但你的过程、你的系统本应推断出来的变量的值。所以这可以被看作是用神经网络实现推理的一种方式。所以你可以把神经网络中的推理看作一个过程,其中你有一个能量函数,它针对某些变量被优化。而作为这种优化结果得到的值,就是那些你试图寻找的变量的值。因此,有一种常见的观点认为神经网络只是一个函数,它根据输入计算输出。所以你只需跑一遍神经网络,就得到一个输出。

[8:43] 但这种推断形式限制性相当强,因为对于给定输入你只能产生一个输出。然而很多时候,对于给定输入存在多个可能的答案。那么,你如何表示这类存在多个答案、多个可能答案的问题呢?对此的一种解答是:让这些答案成为某个能量函数的极小值,而你的推断算法将寻找使该目标函数最小化的变量值。可能存在多个极小值。这意味着你的模型可能对给定输入产生多个输出。明白吗?

[9:21] 所以,基于能量的模型是实现这一点的一种方式。这类基于能量的模型的一个特例是概率模型:比如你所知道的贝叶斯方法、图模型、贝叶斯网络等等。能量方法则更为一般,所以不那么具体。其特例包括人们过去称为结构预测的东西。然后,这在所谓的自监督学习中有大量应用。那将是接下来几节课的主题。所以自监督学习是当今一个非常非常活跃的研究领域。

[9:57] 而且很可能在未来会变得真正占据主导地位。它已经……在一年之内,它已在自然语言处理领域占据主导地位。而在过去几个月,仅仅三个月里,就有几篇论文表明自监督学习方法在计算机视觉等领域实际上也非常有效。所以我猜测,我猜测……自监督学习将会席卷全球,在未来几年内。所以,我认为在这门课上了解一下它是有用的。像——我不会逐一列举——但确实有你可能听说过的东西:比如变分自编码器、去噪自编码器、BERT,也就是那些为自然语言处理训练的 Transformer 架构。它们是用自监督学习训练的,并且是去噪自编码器的一个特例。

[10:45] 所以,其中很多东西你可能听说过,却没意识到它们都属于这一类——它们都可以在这种基于能量的方法的框架下理解。这也包括生成对抗网络(GAN),我相信很多人都听说过。此外还有自监督学习以及更远的方向。那么,我们如何让机器真正变得智能?它们现在并不具备超级智能,也谈不上很智能。它们能很好地解决非常狭窄的问题,有时甚至达到超越人类的表现。但没有任何机器具备常识。而我们目前最智能的机器,其常识可能还不如一只家猫。那么,我们如何先达到猫级别的智能,然后再达到人类级别的智能?

[11:29] 我并不假装自己知道答案,但我有一些在自监督学习背景下值得讨论的有趣想法。我也有过一些应用。有什么问题吗?这就是本课程的安排。好的,它可能会动态调整。但至少,这是我们的意图。有问题吗?……好的……[学生提问:课程中也会有作业吗?] 是的,是的,会有作业。

[12:00] [……听不清……] 好的,所以对于没听清 Alfredo 发言的同学——因为他说话声音不大:期末项目实际上将是各团队之间的竞赛。所以会有排行榜之类的安排。为此,作业基本上就是练习,让你熟悉深度学习总体上所需的各种技术,尤其是为期末项目做准备。

[12:46] [期中考试也是如此。] 对,期中考试显然也是如此。好的,你们大多数人可能知道——对已经接触过这些东西的人来说可能有点无聊——但我们还是从基础开始。深度学习受到人们对大脑观察的启发,但这种启发仅仅是启发。它并不是要复制大脑,因为大脑的许多细节是无关的,而且我们也不知道它们是否真的与人类智能相关。所以这种启发是在概念层面上的。

[13:18] 而且,这跟飞机受鸟类启发有点类似。但鸟类和飞机的飞行基本原理本质上是一样的,只是细节差异极大。它们都有翅膀。它们都通过推动自身穿过空气来产生升力,但飞机没有羽毛,也不会扇动翅膀。所以思路有点相似。这段历史可以追溯到一个几乎已经消失、或者至少现在改了名字的领域,叫做控制论。如果你想找一位研究控制论历史的专家,他就坐在那儿:乔·勒梅林。你能举一下手吗?

[13:57] 所以,乔其实是一位哲学家。他感兴趣的是——他实际上开了一门关于人工智能历史的研讨课。这是在哪个系?[乔:媒体、文化与传播。]媒体、文化与传播。所以不是计算机科学系。他对控制论的历史了如指掌。所以它始于40年代,由两位先生开创:麦卡洛克和皮茨。他们的照片在右上角这里。他们提出了一个想法,当时人们对逻辑很感兴趣,但神经科学还是一个非常新兴的领域。

[14:32] 然后,他们想到,如果神经元基本上就是开或关的阈值单元,那么通过把神经元相互连接起来,你就能构建布尔电路,基本上就能用神经元进行逻辑推理。所以他们说:大脑基本上就是一台逻辑推理机器,因为神经元是二值的。而这个想法——这个想法是,一个神经元计算其输入的加权和,然后将加权和与阈值进行比较。如果高于阈值就开启,低于阈值就关闭。

[15:05] 这是对真实神经元工作方式的一种简化看法——一种非常非常简化的看法。这个模型在该领域沿用了数十年。将近四十年。实际上,整整四十年。然后,几乎同时,唐纳德·赫布提出了一个想法:大脑中的神经元——这是一个古老的想法,即大脑通过改变神经元之间称为突触的连接强度来学习。于是就有了现在所谓的赫布学习,即如果两个神经元同时放电,那么连接它们的连接就会增强。如果它们不同时放电,也许就会减弱。

[15:50] 这算不上学习算法的构想,但或许可以算作一个初步的想法。随后,诺伯特·维纳提出了控制论,他就在这里。[右下角] 其核心思想是,通过构建带有传感器和执行器的系统,就能形成反馈回路,实现自我调节的系统。那么,这背后的理论是什么呢?如今我们对此已习以为常。但设想一下,比如:你开车时转动方向盘,实际上有一个所谓的 PID 控制器,它会根据你转动方向盘的幅度来相应地转动车轮。

[16:36] 这是一种反馈机制,它基本上会测量方向盘的位置,测量汽车车轮的位置。然后,如果两者之间存在差异,就会校正汽车的车轮,使其与方向盘的朝向相匹配。这就是一种反馈机制。其稳定性以及相关规则,最初都源自这项研究。这促使一位名叫弗兰克·罗森布拉特的人设想出能够修改非常简单的神经网络权重的学习算法。你在底部看到的这两张图片[左下角]:这是弗兰克·罗森布拉特,这是感知机。它是一台物理模拟计算机,而不是如今三行 Python 代码就能实现的东西。

[17:24] 它是一台巨大的机器,布满了电线和光学传感器,可以向你展示图片。它的分辨率非常低。然后它有——它有能够计算加权和的神经元,而且权重可以调整。这些权重是电位器。电位器上装有电机,因此它们可以为了学习算法而旋转。所以它是机电式的。他手里拿的是一个包含八个权重的模块(你可以数一数),上面装有那些电位器,即电动电位器。

[18:02] 好了,以上就是神经网络起源的一点历史。另一段有趣的历史是,通过模拟神经元网络来构建智能机器的整个想法诞生于 40 年代,在 50 年代末有所发展,但在 1960 年代、1960 年代末彻底消亡,因为人们意识到,用当时提出的学习算法和架构,做不了太多事情。你只能做一些基本的、非常简单的模式识别,但做不了太多。

[18:36] 所以大致在 1969 到 1968 或 1984 之间,我基本上可以说,世界上没有人在研究神经网络,除了少数孤立的研究者,主要在日本。日本在资助研究方面算是一个相对孤立的生态系统。人们不追随同样的……潮流,如果你愿意这么说的话。然后这个领域在 1985 左右随着反向传播(backprop)的出现再次起飞。反向传播是一种训练多层神经网络的算法,你们很多人应该知道。

[19:20] 人们在 60 年代就在寻找类似的东西,但基本上没有找到。没找到的原因是他们用错了神经元。他们用的是二值化的 McCulloch-Pitts 神经元。要让反向传播奏效,需要使用连续、可微的激活函数,或者至少是连续的。而人们当时就是没有……你知道,使用连续神经元的想法。所以他们不认为可以用梯度下降来训练这些系统,因为这些东西不可微。

[19:56] 这还有另一个原因,就是如果你的神经网络使用二值神经元,你永远不需要计算乘法。你永远不需要把两个数相乘。你只需要做加法,对吧。如果你的神经元是激活的,你只需把权重加到加权和中。如果它未激活,你什么都不做。如果你用连续神经元,就需要把神经元的激活值乘以权重来得到对加权和的贡献。事实证明,在 1980 年代之前,在任何不是贵得离谱的计算机上把两个数相乘,尤其是浮点数,都极其缓慢。所以出于这个原因,人们有动机不使用连续神经元。

[20:34] 所以反向传播没有在 80 年代中期之前出现的原因,基本上就是那时候计算机变得足够快,能够做浮点乘法了。人们当时不是这么想的,但事后回顾来看,基本上就是这么回事。所以在 1985 到 1995 之间出现了一波对神经网络的兴趣热潮——持续了大约 10 年。在 1995 年,它又消亡了。机器学习领域的人基本上放弃了使用神经网络的想法。

[21:05](原因我现在就不细说了。)这种情况一直持续到2000年代末、2010年代初。所以,大约在2009/2010年前后,人们意识到可以用多层神经网络配合反向传播训练,从而提升语音识别的效果。这一切并不是从 ImageNet 开始的,而是从语音识别开始的,大约在2010年。在首批相关论文发表后的18个月内,语音识别领域的每一家主要厂商都已部署了使用神经网络的商用语音识别系统。所以,如果你在2012年前后使用 Android 手机,并且用到了任何基于神经网络的语音识别功能,那大概就是现代深度学习形式第一次真正、真正大规模的部署了。

[21:55]然后在2012年底、2013年初,同样的事情在计算机视觉领域发生了:计算机视觉界意识到,深度学习、尤其是卷积网络,比他们之前用的任何方法都要好得多,于是开始转向使用商用网络,基本上抛弃了此前所有的技术。这就造就了第二次革命,这次是在计算机视觉领域。又过了三年,大约在2016年前后,同样的事情又发生在自然语言处理领域——在语言翻译之类的事情上:2015/16。

[22:28]而现在,我们将会看到——这还没有发生——但我们将会看到同样的革命发生在机器人、控制以及你知道的一大堆应用领域。不过让我先讲这一点:好。所以,你们肯定都知道什么是监督学习。而这实际上就是绝大多数——不,不是绝大多数——90% 左右的深度学习应用所使用的主要方式,也就是监督学习。所谓监督学习,就是你收集一大堆输入和输出的配对样本,比如图像连同类别(如果你想做图像识别的话),或者一堆音频片段连同它们的文本转写:一种语言的一堆文本连同另一种语言的转写,等等。

[23:22],然后你给机器喂一个示例。它产生一个输出。如果输出正确,你什么都不做,或者不做太多。如果输出不正确,你就调整机器的参数。(可以把它看作某种参数化函数。)你调整该函数的参数,使输出更接近你期望的结果。好,这就是监督学习的非技术性解释。给系统看一张汽车的图片,如果系统没有说“汽车”,就调整参数。神经网络中的参数就是权重,你知道的,就是在那些模拟神经元中计算加权和的权重。

[24:03]调整旋钮,使输出更接近你想要的那个。神经网络的诀窍在于:你如何确定朝哪个方向、调整多少来转动旋钮,使输出更接近你想要的那个?这就是梯度计算和反向传播的内容。但在讲这个之前,再讲一点历史。曾经涌现出一批模型,用于分类的基础模型。你知道,从感知机开始,还有另一个竞争模型叫 Adaline,就在右上角这里。它们基于相同类型的基础架构:计算输入的加权和并与阈值比较。如果高于阈值,就开启;如果低于阈值,就关闭。

[24:45]你看到的这里的 Adaline,Bernie Widrow 正在调整的东西实际上又是一台物理模拟计算机。所以它像感知机,但在很多方面要小得多。我告诉你这些的原因是,感知机实际上是一个两层神经网络,一个第二层可训练、具有自适应权重的两层神经网络。但第一层是固定的。事实上,大多数时候在大多数实验中,它是随机确定的。你会把图像的输入像素随机连接到神经元,这些神经元本质上就是带有随机权重的阈值神经元。

[25:27]这就是他们所说的关联层。这基本上成为了接下来四十年里模式识别系统概念设计的基础。我想说四十年。是的,差不多。所以,那个模型就是:你取一个输入,让它通过一个特征提取器,该提取器应该提取出对任务有用的输入的相关特征。

[26:01] 那么,你想识别人脸?你能检测到眼睛吗?你如何检测眼睛?嗯,某处可能有一个暗色的圆圈。诸如此类,对吧?你想识别汽车,你知道的。嗯,它们算是某种暗色的、圆的东西,等等。所以,这里的问题在于——这个特征提取器产生的是一个特征向量,这些特征可能是数值,也可能是开或关的状态。好,所以它就是一个数值列表,一个向量。然后你要把这个向量喂给可训练的分类器。对于感知机或简单的神经网络来说,它就是一个计算加权和、并与阈值比较的系统。

[26:41] 问题在于你必须手工设计特征提取器。所以整个模式识别文献(至少是统计模式识别)以及大量计算机视觉研究(至少是计算机视觉中关注识别的那部分)都聚焦于这一部分:特征提取器。你如何为特定问题设计特征提取器?比如你想做,我不知道,韩文字符识别。识别韩文的相关特征是什么?你如何用各种算法技巧来提取它们?你如何预处理图像?你知道的,如何归一化它们的大小?诸如此类。

[27:16] 你如何对它们做骨架化?你如何将它们从背景中分割出来?所以整个文献都致力于这个[特征提取器],而极少致力于那个[可训练分类器]。而深度学习带来的理念是:不再采用这种两阶段的模式识别流程——其中一个阶段是手工构建的,输入的表征本质上是某个手工设计程序的结果。

[27:48] 深度学习的理念是端到端地学习整个任务。好,基本上就是把你构建的模式识别系统,或者你想用它做的任何事情,构建成一系列模块的级联或序列。所有这些模块都有可调参数。它们都包含某种非线性。然后你把它们堆叠起来,堆叠多层,这就是它被称为深度学习的原因。所以深度学习中“深度”一词的唯一原因就是存在多个层。仅此而已。

[28:20] 然后你对整个系统进行端到端训练。所以这里的复杂之处当然在于,第一个框里的那些参数:你如何知道怎样调整它们,使输出——你知道的——更接近你想要的输出?这就是反向传播为你做的事情。好,为什么所有这些模块都必须是非线性的?因为,如果你有两个连续的模块,而它们都是线性的,你可以把它们合并成一个单一的线性模块。对,两个线性函数的乘积,或者说两个线性函数的复合,是一个线性函数。取一个向量乘以一个矩阵,然后再乘以第二个矩阵。

[28:59] 这就好像你预先计算了那两个矩阵的乘积,然后用那个复合矩阵去乘输入向量。所以如果那些层是线性的,拥有多个层就没有意义。好,其实是有意义的,但那是一个次要的意义。所以,既然它们必须是非线性的,你能想象的最简单的、带有可调参数——比如神经网络中的权重——并且是非线性的多层架构是什么?

[29:38] 你很快会意识到它必须看起来像这样:那么……取一个输入。输入可以表示为一个向量,对吧。一张图像不过是一串数字。把它看作一个向量,暂时忽略它是图像这件事。一段音频,无论你的传感器或数据集给你的是什么,都是一个向量。把这个向量乘以一个矩阵。这个矩阵中的系数就是可调参数。然后取得到的向量,对吧——当你用一个矩阵乘以一个向量时,你得到一个向量。

[30:15] 把这个向量的每个分量通过一个非线性函数。而且,如果你想要最简单的非线性函数,就用这里顶部所示的那个 [ReLU(x) = max(x, 0)],神经网络领域的人称之为 ReLU;工程领域的人称之为半波整流;数学领域的人称之为正部。你想怎么叫都行,好吧。所以,把这个非线性函数应用到由输入向量乘以矩阵所得到的向量的每一个分量上。

[30:47] 好。现在你得到一个新的向量,其中包含大量零,因为只要加权和小于零,经过 ReLU 后输出就是零。然后重复这个过程:取该向量,乘以权重矩阵;将结果通过逐点非线性;取结果,传递——乘以矩阵——将结果通过非线性。这基本上就是一个基础神经网络。好,那么为什么它被称为神经网络呢?因为当你取一个向量并乘以一个矩阵时,为了计算输出的每个分量,你实际上是对输入的分量进行加权求和,权重来自矩阵中对应的行,对吧。所以这里这个小符号——有一堆向量的分量进入这一层。然后,你取矩阵的一行,计算这些值的加权和,其中权重是

[31:51] 该矩阵行中的值,这就得到了一个加权和。你对每一行都这样做,就得到了结果,对吧。所以,乘以矩阵后的单元数量将等于矩阵的行数。而矩阵的列数当然必须等于输入的大小。好。那么监督学习——用比我之前展示的稍微更正式的说法——就是你将系统产生的输出进行比较的思想……

[32:26] 所以,对,你展示一个输入,让它通过神经网络,得到一个输出。你将把这个输出与目标输出进行比较。你将有一个目标函数、一个损失模块,它计算距离、差异、惩罚——随你怎么叫。散度——好,有各种名称。然后你将计算它的平均值。所以这个代价函数的输出是一个标量,对吧。

[32:56] 它计算距离,例如目标向量与神经网络产生的向量、深度学习系统产生的向量之间的欧几里得距离。然后你可以计算这个代价函数的平均值,它只是一个标量。你将在训练集上对它求平均,对吧。所以,训练集由一堆输入和输出对组成;在训练集上计算这个的平均值。你想要相对于系统参数(可调旋钮)最小化的函数,就是那个平均值。好。所以,你想要找到使所需输出与所得输出之间的平均误差最小化的参数值,该平均误差是在训练样本集上平均的。

[33:47] 所以……我相信在座的绝大多数人,至少对梯度下降有一个直观的理解。基本上,最小化它的方法就是计算梯度,对吧。这就像你在一座山里迷了路(而且是一座非常平滑的山),但当时有雾又是夜晚,你想走到山谷里的村庄。所以,你能做的最好的事情就是转过身,看看哪个方向是向下的,然后朝着最陡下降的方向迈出一步。

[34:22] 好。那么,这种寻找下降方向的过程:就叫做“计算梯度”,或者严格来说,是负梯度。好,然后你向下迈一步。这就是沿着负梯度方向向下迈一步。如果你一直这样做,而且步子足够小——小到当你迈出一步时,不会跳到山的另一边——那么最终你会收敛到山谷,前提是这个山谷是凸的。这意味着什么?意味着如果中间没有那种湖泊,没有山间湖泊,也就是没有那种局部极小值让你卡在那里——山谷可能更低,但你看不到它。

[35:03] 好。所以这就是为什么凸性作为一个概念很重要。但还有另一个概念,就是随机梯度的概念,我相信你们很多人也听说过。我后面会更详细地再讲这个。你计算的目标函数是许多许多样本上的平均值。你可以通过对整个训练集求平均,来计算整个训练集上的目标函数及其梯度。

[35:37] 但事实证明,更高效的做法是只取一个样本或一小批样本,计算这个样本产生的误差,然后计算该误差关于参数的梯度,并迈出一步。一小步。然后来了一个新样本——你会得到另一个误差值和另一个梯度值,方向可能不同,因为这是不同的样本。然后朝那个方向迈一步。如果你一直这样做,你会沿着代价曲面下降,但是以一种带噪声的方式——会有很多波动。

[36:16] 那么这里展示的就是一个例子。这是将随机梯度应用于一个非常简单的二维问题,其中只有两个权重。它看起来有点半周期性,因为样本总是以相同的顺序出现,而这并不是随机梯度应该采用的做法。但如你所见,路径非常不规则。人们为什么使用它?有各种原因。一个原因是,从经验上看,它收敛得快得多,尤其是在训练集非常大的情况下。另一个原因是,最终你实际上能获得更好的泛化能力。所以如果你在一个单独的集合上衡量系统的性能——我假设你们都了解“训练集”、“测试集”和“验证集”的概念,但是——所以如果你在不同的集合上测试系统的性能,使用随机梯度通常比使用真正的梯度下降获得更好的泛化能力。

[37:05] 问题是……是的。[学生提问,听不清]。不。它更糟。所以计算整个数据集的完整梯度——。这在计算上是可行的。我的意思是你可以做到。它并不比……你知道……[学生评论,听不清]更昂贵。它的噪声会更小,但会更慢。所以让我告诉你为什么:我的意思是,这是我们在讨论优化时会再次谈到的东西。

[37:37] 但让我告诉你:我给你一个包含一百万个训练样本的训练集。它实际上是同一个训练样本重复了100次,每次有10,000个样本。好吧。所以我实际的样本是10,000个训练样本。我把它复制了100次,并声称,你知道,我把它打乱了。我告诉你这就是我包含一百万个训练样本的训练集。所以如果你做完整的梯度计算,你会把相同的值计算一百次。你会花费比必要多一百倍的工作量。

[38:09] 在不知不觉中。好吧。所以这仅仅因为重复才有效。但它在机器学习中更正常的情况下也有效,即你的样本中有大量冗余,比如很多样本彼此非常相似等等。所以如果存在任何形式的一致性——如果你的系统能够泛化,那就意味着随机梯度会更高效,因为如果你不使用随机梯度,你就无法利用这种冗余。所以这就是噪声对你有利的一种情况。

[38:46] 好的。先别在意这个公式。别被吓到,因为我们后面还会更详细地回到这里。但是,为什么反向传播叫反向传播?再说一次,这非常不正式。它基本上就是链式法则的一个实际应用。所以你可以把之前展示给你的那种神经网络看作是一堆堆叠在一起的模块。你可以把它看作函数的复合。你们都懂微积分的基本规则。你知道,如何计算一个函数与另一个函数复合后的导数?

[39:22] 那么,F 与 G 复合的导数,就是 F 在 G 的 X 处的导数,乘以 G 在 X 处的导数。对吧。所以你得到两个导数的乘积。这里也是一样,只不过这些函数不是标量函数,而是向量函数。它们以向量为输入,以向量为输出。更一般地说,实际上它们以多维数组为输入、以多维数组为输出,但这不重要。基本上,对于有多个输入、多个输出、可以看作函数的模块,这个链式法则的推广是什么?对吧。

[40:06] 基本上,如果你盲目地套用,规则是一样的——和你用于普通导数的规则一样。(只不过这里要用偏导数。)你知道,最终你看到的就是这个。如果你想计算你想要的输出和你得到的输出之间的差,也就是你的目标函数的值,对网络内部任何变量的导数,那么你就得把导数反向传播回去,并在途中把东西乘起来。

[40:37] 好的。下周我们会更正式地讲这个。现在,你只要知道它为什么叫反向传播:因为它适用于多层。好,那么,我之前展示的这个神经网络图很好,但如果输入实际上是一张图像呢?对吧。一张图像,即使是分辨率相对较低的图像,通常每边也有几百个像素。

[41:12] 好。那么,假设是 256 x 256,随便举个例子。好,一张汽车图像:256 x 256。所以它有 65,536 个像素,乘以三,因为每个像素都有 R、G、B 三个分量,也就是说每个像素有三个值。所以这大约是二十万个值。好,那么这里的向量就是一个有两百个分量的向量。如果你有一个矩阵要乘以这个向量,这个矩阵就必须有两百行——列,抱歉。

[41:50] 而取决于第一层里有多少个单元,就会是一个 200,000 x,你知道,可能很大的数。那是一个巨大的矩阵。对吧。即使它是 200,000 x 100,000。所以你在第一层就有了压缩,你知道,那已经是一个非常大——非常非常大的矩阵:数十亿。所以把它当作一个完整的矩阵来想并不现实。如果你想处理图像之类的东西,就必须对这个矩阵的结构做出一些假设,使它不是一个把一切都与一切相连的完全稠密矩阵。

[42:33] 那会不切实际。至少对许多实际应用来说是这样。所以这就是来自大脑的灵感回归之处。神经科学中有一些工作,经典的工作,在 1960 年代,由上面这两位先生:Hubel 和 Wiesel 完成。他们实际上因此在 70 年代获得了诺贝尔奖。但他们的工作是 50 年代末到 60 年代初。他们所做的是把电极插进各种动物的视觉皮层:你知道,猫、猴子、老鼠等等。

[43:05](我想他们很喜欢猫。)他们试图弄清楚视觉皮层中的神经元在做什么。他们发现的是——首先,嗯,这是人类的大脑。但我是说,这张图来自更晚得多的时期。但所有哺乳动物的视觉系统都以类似方式组织。信号进入你的眼睛,打在视网膜上。在光感受器前面,视网膜中有几层神经元,可以说会对信号进行预处理。它们会压缩信号,因为你不可能有——你知道人眼大约有一亿像素。

[43:49] 所以这就像一台一亿像素的相机,百万像素相机。但问题是你不可能让一亿根纤维从你的眼睛里伸出来,否则你的视神经就会这么大。而且你就无法转动眼球了。所以视网膜前面的那些神经元会做压缩。它们不做 JPEG 压缩,但确实会做压缩。这样信号就能被压缩到一百万根纤维。对。每只眼睛有一百万根纤维伸出来。这就让你的视神经大约有这么粗,这意味着你可以承载信号并转动眼睛。

[44:26] 这其实是进化在脊椎动物身上犯的一个错误。无脊椎动物不是这样。无脊椎动物实际上——所以,这是个很大的错误,因为从视网膜收集信息的导线,也就是在视网膜前面处理信号的神经元,这些导线不得不——它们会位于视网膜前面,所以可以说会挡住一部分视野。然后它们还得在视网膜上打个洞才能通到大脑。

[44:59] 所以你的视野里有一个盲点,因为那就是视神经穿过视网膜的地方。所以如果你有一台这样的相机,导线从前面伸出来,然后在传感器上挖个洞把导线接回去,这有点荒谬。如果导线从后面伸出来就好多了,对吧?脊椎动物搞错了。无脊椎动物搞对了。所以,像鱿鱼和章鱼,它们的导线实际上是从后面伸出来的。它们幸运多了。不过话说回来。

[45:33] 所以,信号从你的眼睛传到一小块叫外侧膝状核的大脑区域,它实际上在大脑下方——在它的底部。它会做一点对比度归一化。我们几节课后还会再讲这个。然后,信号传到大脑后部,那里是初级视觉皮层区域,叫做 v1。在人类中它叫 V1。还有一个叫腹侧层级的东西:V1、V2、V4(IT),这是一堆从后部延伸到侧面的脑区。而就在这里的下颞叶皮层,这是物体类别被表征的地方。

[46:17] 所以,当你环顾四周看到你的祖母时,这个区域里有一群神经元在放电,代表你的祖母。无论你的祖母穿着什么、处于什么姿势、是否有遮挡等等,只要你看到祖母,这些神经元就会放电。所以这是类别层面的东西。这些发现来自对患者进行的实验——这些患者不得不开颅数周,人们把电极插进去,让他们看电影,然后发现,当电影里出现詹妮弗·安妮斯顿的时候,这个神经元就会激活。而且它只对詹妮弗·安妮斯顿激活。

[47:03] 所以,基于视觉上下文能够进行模式识别、并且似乎具有这种层次化、多层结构的想法,还有一种观点认为视觉过程本质上是一个前馈过程。所以你识别一个日常物体的过程非常快,大约需要 100 毫秒。信号从视网膜传到下颞叶皮层的时间几乎不够。每经过一个神经元大约有几毫秒的延迟。

[47:36] 100 毫秒的时间里,你几乎没有时间让几个脉冲走完整个系统。所以没有时间进行循环连接之类的处理。这并不意味着没有循环连接。循环连接有大量,但快速识别在某种程度上是在没有它们的情况下完成的。这被称为前馈腹侧通路。而这位先生,福岛邦彦,在 70 年代受到 Hubel 和 Wiesel 的启发,在计算机上构建了一个神经网络模型,这个模型有分层的想法,同时也有 Hubel 和 Wiesel 发现的另一个想法:单个神经元只对视野的一小部分做出反应。

[48:22] 于是他们把电极插入 V1 的神经元中,发现 V1 中的这个神经元只对出现在视野中很小区域内的图案做出反应。然后它旁边的神经元会对紧邻第一个区域的另一个区域做出反应,对吧。所以这些神经元似乎以一种称为视网膜拓扑的方式组织,这意味着相邻的神经元对视野中相邻的区域做出反应。他们还发现,对视野中同一区域做出反应的那组神经元,似乎会对特定方向的边缘激活。所以一个神经元会在其感受野中有边缘、一条垂直边缘时激活,然后旁边的那个会在边缘稍微倾斜时激活,再旁边的那个会在边缘稍微旋转时激活,等等。

[49:09] 于是他们就有了关于 V1 的这幅图景,基本上就是朝向选择性,也就是神经元观察局部视野然后对朝向做出反应。而那些对多个朝向做出反应的神经元群组在整个视野中被复制。所以这位 Fukushima 说,那好,我为什么不构建一个能做到这一点的神经网络呢?我不一定坚持我的系统要提取朝向特征,但我会用某种无监督学习算法来训练它。所以他并不是端到端地训练他的系统。他是以某种无监督的方式逐层训练的,具体细节我就不展开了。

[49:48] 然后他借用了另一个概念,他借用了这些神经元在整个视野中被复制的概念,接着他又借用了 Hubel 和 Wiesel 的另一个概念,叫做复杂细胞。复杂细胞是汇集一群简单细胞活动的单元,这些简单细胞就是那些具有朝向选择性的单元。它们以这样的方式汇集:如果一条朝向边缘移动了一点点,它会激活不同的简单细胞,但复杂细胞由于整合了所有这些简单细胞的输出,会保持激活状态,直到边缘移出它的感受野。

[50:32] 所以那些复杂细胞在表征中建立了一点平移不变性。你可以把一条边缘稍微移动一下,它不会改变那些复杂细胞中某一个的激活活动。这就是我们现在在卷积网络语境下所说的“卷积”和“池化”。而这基本上就是我在 80 年代中期或 80 年代末提出卷积网络的原因。所以它们基本上就是这样的网络:连接是局部的;它们在整个视野中被复制;然后你在检测这些局部特征的特征检测层之间穿插池化操作。我们将在三周后详细讨论这一点。

[51:21] 所以我不会深入每一个细节。但它确实复用了 Hubel 和 Wiesel 以及 Fukushima 的这个想法(如果我能找到我的指针的话……)。基本上,一层中的每个神经元计算输入一小块区域的加权和,而这个加权和使用那些权重。但这些权重是被复制的,所以一层中的每个神经元都使用同一组权重。好,这就是权重绑定或权重共享的思想。

[51:57] 所以,利用反向传播,我们能够训练出像这样的神经网络来识别手写数字。这要追溯到80年代末90年代初。这就是我,当时和你们差不多大,可能稍大一点。在这个视频里我大约三十岁。这是我当年在贝尔实验室工作时的电话号码。现在已经打不通了。那是一个新泽西的号码。我按下一个键,就有一个运行在386 PC 上、配有专用加速卡的神经网络在识别那些字符,运行的神经网络与我刚才给你们展示动画的那个非常相似。

[52:34] 这个东西能够识别任何风格的字符,包括非常奇怪的风格,甚至更奇怪的风格。所以这在当时算是很新颖的,因为那时候字符识别,或者说一般的模式识别,还停留在这样的模式上:我们提取特征,然后在上面训练一个分类器。而这个基本上能够训练整个——从端到端地学习整个任务。

[53:08] 基本上,那个神经网络的前几层会扮演特征提取器的角色,但它是从数据中训练出来的。我们之所以使用字符识别,是因为这是当时我们唯一拥有数据的任务。唯一有足够数据的任务要么是字符识别,要么是语音识别。语音识别的实验取得了一些成功,但没那么大。很快,我们意识到我们可以用这些卷积网络不仅识别单个字符,还能识别字符组,也就是一次识别多个字符。正是由于网络的这种卷积特性——我将在三讲之后回到这一点——基本上让这些系统能够直接应用于一张大图像,然后只要它们在视野中看到、只要看到它们能识别的形状,就会激活。

[54:02] 所以,基本上,如果你有一张大图像,你训练一个卷积网络,它有一个小的输入窗口,你把它在整个图像上滑动,每当它激活,就意味着它检测到了你训练它检测的对象。所以这里的系统能够同时进行分割和识别。在那之前,模式识别领域的人会有一个显式的程序,把单个对象从背景中、从彼此之间分离出来,然后把每个单独的对象,比如字符,送给一个识别器。但有了这个,你可以同时做这两件事。

[54:35] 你不必担心这一点。你不需要为此构建任何特殊程序。因此,这尤其可以应用于自然图像,用于人脸检测、行人检测等任务。没错。同样地,训练一个卷积网络来区分有脸的图像和没有脸的图像,用几千个样本进行训练,然后取那个窗口,在图像上滑动:每当它激活时,就说明有脸。当然,脸可能比窗口大,所以你对图像进行下采样:把它缩小,再次滑动你的网络,然后再缩小,再次滑动网络。这样你现在就可以检测任意大小的人脸了。

[55:15] 好的。特别是你可以用这个来驱动机器人。所以这些是在深度学习流行之前所做的工作,好的。所以这是一个例子,这里的网络是一个卷积网络。它被应用于来自摄像头的图像,来自你知道的,运行中的机器人。它试图对每个小窗口——比如 40 x 40 像素左右,甚至更小——进行分类,判断该窗口中的中心像素是在地面上还是障碍物上,对吧。

[55:48] 所以它分类为在地面上的都是绿色。分类为障碍物的都是红色或紫色,如果是在障碍物的底部的话。然后你可以把它映射到一张地图上,就是你在顶部看到的。然后在这张地图中进行规划以到达特定目标,然后用它来导航。所以这是两位前博士生。右边是 Raia Hadsell,左边是 Pierre Sermanet,他们正在烦扰这个可怜的机器人。

[56:20] 相当确信机器人不会弄断他们的腿,因为他们实际上编写了代码并训练了它。Pierre Sermanet 是加州 Google Brain 的研究科学家,从事机器人研究。Raia Hadsell 是机器人研究负责人——DeepMind 的机器人研究总监。他们做得相当不错。所以类似的想法可以用于所谓的语义分割。所以语义分割是这样的想法:你可以,同样地,用这种滑动窗口方法,训练一个卷积网络,使用窗口作为上下文来对中心像素进行分类。

[56:58] 但在这里,它不仅仅是训练来区分障碍物和非障碍物。它被训练来分类大约 30 个类别。这是——我想这是华盛顿广场下坡路。这是华盛顿广场公园。而且,你知道,它认识道路、行人、植物、树木等等——但它却在华盛顿广场公园正中间发现了沙漠,这并不……据我所知那里没有海滩……所以它并不完美。不过在当时,它是最先进的技术。那是当时做这类语义分割最好的系统。

[57:36] 那时候我四处奔走演讲,试图向人们宣传深度学习。这大约是在 2010 年。所以可以说,这是在深度学习革命之前。有一个人,一位来自以色列的教授,坐在我的一场演讲听众中。他是个理论家,但他真的被这项技术的潜在应用深深吸引,而且他当时正要休学术假,去一家叫 Mobileye 的公司工作,那家公司当时是以色列的一家初创企业——在做自动驾驶。所以,在他听了我的演讲几个月后,他开始在 Mobileye 工作。

[58:15] 他告诉 Mobileye 的人——"你们应该试试这种卷积网络的东西。这效果非常好。"那里的工程师们说——算了吧。不,我们不相信那套东西。我们有自己的方法。于是他把它实现出来,自己试了试,把他们所有的基准测试都打得落花流水。突然间,整个公司都转向使用卷积网络。他们也是第一家真正为汽车做出视觉系统的公司,你知道,能让汽车保持在高速公路上行驶,并且能在有行人或骑行者横穿时刹车。我稍后会再回到这一点。他们基本上就是在用这项技术。

[58:54] 语义分割,和我之前给机器人展示的那个非常相似。这是一个叫 Shai Shalev-Schwartz 的人做的。你还必须意识到,早在 80 年代,人们就对使用、对实现能够非常快速地运行神经网络的特殊类型硬件非常感兴趣。这些是实际实现过的一些神经网络芯片的例子——其中一些和我有关——但它们是由和我当时在新泽西贝尔实验室同一个小组工作的人实现的。

[59:28] 所以这在 1980 年代算是个热门话题,后来随着神经网络研究在 90 年代中期逐渐衰落,人们就不再研究这个了,直到几年前才重新兴起。现在芯片设计领域、芯片行业最热门的话题就是神经网络加速器。你去参加任何计算机体系结构会议,比如 ISSCC——这是固态电路领域的大型会议——一半的报告都是关于神经网络加速器的。

[1:00:03] 我参与过其中一些工作。好,后来发生了一些事情,正如我跟你说过的,大约在 2010、13、15 年前后,在语音识别、图像识别、自然语言处理领域,而且还在持续。我们现在正处于其他主题的浪潮之中。发生的事情——我很遗憾地说,这并非发生在我们实验室,而是和我们的朋友们一起——我们和 Yoshua Bengio、Geoff Hinton 在 2000 年代初就开始了。我们知道深度学习效果非常好,也知道整个社区因为否定神经网络和深度学习而犯了错误。所以——我们当时还没用“深度学习”这个词,是几年后才发明的——大约在 2003 或 2004 年前后,我们开始了一场“阴谋”,如果你愿意这么说的话。我们聚在一起说,我们要试着打破一些记录、在一些数据集上取得突破,发明一些新算法,让我们能够训练非常大的神经网络。

[1:01:03] 这样我们就能收集非常大的数据集,向世界证明这些东西真的有效,因为当时没人真正相信。这真的超出了我们最疯狂的想象。特别是,在 2012 年,Geoff Hinton 有一个学生 Alex Krizhevsky,他花了很多时间在 GPU 上实现卷积网络,当时 GPU 还算比较新——并非全新,但开始变得非常高性能。所以他非常擅长这方面的工作,然后他们能够训练出比以往任何人都大得多的神经网络、卷积网络。

[1:01:44] 于是他们用它来在 ImageNet 数据集上训练。ImageNet 数据集是一堆自然照片。系统需要在 1,000 个不同类别中识别出照片中的主要物体。训练集有 1.3 百万个样本,算是挺大的。所以他们做的是构建了一个非常大、非常深的卷积网络,基本上沿用了我们之前的模型,在 GPU 上实现,让它运行了几周。就这样,他们以很大的优势击败了最好的竞争系统。这是 ImageNet 上回溯到 2010 年的错误率。所以 2010 时大约是 28% 的错误率,top 5。

[1:02:35] 所以,基本上,如果正确的类别不在 1,000 中的前 5 名之内,你就会得到一个错误。好,所以这是一种比较温和的错误度量。2011 是 25.8%,能够做到这一点的系统实际上非常非常大。它有点像是卷积网络,但它并没有被训练。我的意思是只有最后一层被训练了。然后 Geoff 和他的团队把它降到了 16.4%,那对计算机视觉界来说是一个分水岭时刻。很多人说,好,你知道现在我们知道这东西管用了。

[1:03:18] 整个学界从在 2011 和 2012 年基本上拒绝每一篇包含神经网络的论文,转变为在 2016 年拒绝每一篇不包含卷积网络的论文。所以现在它成了新的宗教,对吧。你要是不用某种方式使用 ConvNet,就没法在计算机视觉会议上发表论文。而且错误率下降得非常快,你知道人们发现了各种各样非常巧妙的架构技巧,那些技巧多少让这些东西运行得更好。而你在那里会看到的是层数的膨胀。

[1:03:56] 所以我在 90 年代的卷积网络大约有 7 层,以及从 2000 年代初开始。然后 AlexNet 有,我不知道,12。然后第二年之后的 VGG 有 19。GoogLeNet 有我不知道多少层,因为很难弄清楚你怎么数。然后现在物体识别的主力,人们所称的标准骨干网络,有 50 层。它叫 ResNet-50。但有些,你知道,有些网络大约有 100 层。

[1:04:29] 所以 Alfredo 几年前制作了这张图表,显示每个那些斑点是一个特定的网络架构。横轴是计算输出所需执行的数十亿次操作的数量。好,那些东西真的很大。数十亿个连接。纵轴是在 ImageNet 上的 top one 准确率。所以这和我之前给你展示的性能度量不一样。所以今天最好的系统大约在 84 左右。

[1:05:01] 而斑点的大小是内存占用,也就是你需要存储权重、权重值所需的数百万个浮点数。现在人们在压缩这些东西方面非常聪明,比如。你知道对它们进行量化,而且。Google、Facebook 和其他各个地方都有整个团队只致力于优化那些网络并压缩这些。东西,以便它们能快速运行。因为,只是给你一个粗略的概念,例如 Facebook 每天在其服务器上运行卷积网络的次数是数百亿次。

[1:05:44] 好的。因此,优化所需的计算量有着巨大的动力。所以其中一个……卷积网络之所以如此成功的一个原因是,它们利用了自然数据的一个特性,即组合性。那么,组合性就是这样一个特性:场景由物体组成;物体由部件组成;部件由子部件组成;子部件实际上是基元的组合;而基元是轮廓或边缘,或者说纹理的组合。

[1:06:33] 而这些又只是像素的组合。好的,所以存在这种所谓的组合层级结构,即层级中某一层的特定物体组合构成了下一层的物体。因此,如果你在网络架构中模仿这种组合层级结构,并让它学习某一层中适当的特征组合,从而构成下一层的特征,那正是深度学习的本质。

[1:07:06] 好的。学习表征世界并利用世界的结构——而世界,即这样一个事实:世界中存在组织性,因为世界是组合性的。一位名叫斯图尔特·杰曼的统计学家,他在布朗大学,说过——他是在借用爱因斯坦那句著名的话,爱因斯坦说:世界最不可理解的事情就是它是可理解的。就像,在世界所有复杂的事物中,世界可能极其复杂,复杂到我们无法理解它。

[1:07:42] 而我们至少能理解世界的一部分,这看起来像是一个阴谋。所以斯图尔特·杰曼对此的版本是:世界是组合性的……或者存在上帝。(因为如果世界不是组合性的,你需要超自然的东西才能理解它。)所以这带来了计算机视觉等领域的惊人进展,你知道,从能够不可靠地识别、检测人,到能够为每个物体生成掩码、精确的掩码,然后甚至能推断姿态,然后在移动平台上实时完成这些,你知道。

[1:08:25] 我的意思是,进展可以说是令人难以置信,而其中大部分都基于两个基本的架构家族。这种所谓的一次性目标检测/识别架构,叫做 RetinaNet、特征金字塔网络。有各种名字。或者 U-Net。然后另一种类型叫做 Mark-RCNN,两者实际上都源自 Facebook。或者说,最初提出它们的人现在在 Facebook——他们有时在来 Facebook 之前就想出了这些。

[1:08:59] 但是,你知道,这些东西效果非常好,你知道,它们能做这样的事情:检测被部分遮挡的物体,并且,你知道,为每个物体绘制掩码。所以基本上,这是一个神经网络,一个卷积网络,输入是一张图像。但输出也是一张图像。事实上,输出是一大堆图像,每个类别一张。对于每个类别,输出该类别物体的掩码。这些东西还能做所谓的“实例分割”。所以如果你有一大群羊,它不仅能告诉你这个区域是羊,还能实际挑出每一只羊并把它们区分开,还能正确数出羊的数量,然后睡着。

[1:09:40] 这就是你该做的,对吧,要睡着就数羊,对吧?深度学习的酷之处在于,很多社区成员都接受了这样一个理念:研究必须在开放中进行。所以我们接下来要讲的很多东西,你们可能也知道,在课程里,不仅仅是发表出来,而且是,你知道,连同代码一起发表。不仅仅是代码,实际上是预训练模型,你可以直接下载并运行。

[1:10:13] 全部开源。全部免费使用。所以这真的很新。我的意思是,人们过去不这样搞研究,尤其是在工业界。但即使在学术界,人们也不习惯分发自己的代码。但深度学习不知怎么地,这场竞赛在某种程度上驱使人们更加开放地对待研究。所以这一切有很多应用,就像我说的,你知道,自动驾驶汽车。这实际上是来自 Mobileye 的一段视频,Mobileye 在将卷积网络用于自动驾驶方面相当早。

[1:10:45] 以至于在 2015 年,他们设法把卷积网络塞进他们为其他目的设计的芯片里。他们把这技术授权卖给了特斯拉。所以最早的自驾特斯拉,我是说自驾,不是真正的自动驾驶,它们有驾驶辅助,对吧。它们能在高速公路上保持车道并变道——用的就是这套 Mobileye 系统。而且,这很酷。所以那就是一个卷积网络。它是一块小芯片,你知道,就在,它朝窗外看,就在后视镜后面。

[1:11:18] 从那时起——你知道,四五年前——从那时起,这类技术已被许多不同的公司广泛部署。Mobileye 现在仍被英特尔收购,他们在这些视觉系统市场上占有大约 70 或 80 的份额。但是,有很多公司——以及汽车制造商——都在使用这些东西。所以事实上,在一些欧洲国家,每一辆出厂的汽车,甚至低端车,都配备了基于卷积网络的视觉系统。他们称之为:紧急、紧急、那种,高级紧急制动系统或自动紧急制动系统。

[1:11:56] 例如,AEBS 在法国的每辆车上都有部署。它将碰撞减少了 40%。所以并不是路上的每辆车都配备了它们,因为你知道人们会长期保留自己的车。但这意味着它拯救了生命。所以这是深度学习一个非常积极的应用。另一个大的应用类别当然是医学影像。所以这大概是如今放射学中最热门的话题——如何将 AI(也就是卷积网络)用于放射学。这张[幻灯片图片]取自我们纽约大学的几位同事的一篇论文,他们分析了 MRI 图像。所以卷积网络有一个很大的优势:它们不需要看屏幕就能看 MRI。特别是为了能够看 MRI,它们不必将其切成 2D 图像。

[1:12:56] 它们可以查看整个 3D 体积。这是这个东西所利用的一个特性。它是一个 3D 卷积网络,查看 MRI 图像的整个体积,然后产生,你知道,它使用了与我之前展示的非常相似的技术,用于语义分割。它产生,它基本上在输出图像上,只要有某个东西的地方就点亮,你知道,这里是股骨,但你知道,它可能是——所以这就是它产生的那种结果。它在 3D 中比在 2D 切片中效果更好。或者,当它在乳房 X 光片中检测到恶性肿瘤时,它可以点亮。(这是针对 2D,不是 3D。)

[1:13:37] 而且,你知道,医学影像领域还有各种其他项目正在进行。好的。科学和物理学、生物信息学中有大量应用,你知道,随便什么,我们稍后会回到这些……好的。所以深度学习中存在许多谜团。它们并非完全的谜团,因为人们对这一切有一些理解,但它们是谜团,因为我们没有,比如说,一个对一切都很完善的理论。

[1:14:11] 它们为什么如此有效?多年前,当我试图说服世人深度渴望是个好主意时,理论家们提出的一个大问题是,他们会告诉我:嗯,你只用两层就能逼近任何函数,为什么还需要更多层?我稍后会回到这个问题。卷积网络有什么特别之处?我谈到了自然图像,或者一般自然数据的组合性。这对语音以及信号值、自然信号也同样成立。但这似乎有点牵强。

[1:14:45] 我们如何能够训练这个系统,尽管我们要最小化的目标函数非常非凸。我们可能有很多局部极小值。这是人们当年对神经网络提出的一大批评,那些从未玩过神经网络的人在旧日子里对神经网络大加抨击。比如说,你知道,你无法保证你的算法会收敛——你知道,这太可怕了。我不会用它。最后一个问题是:为什么我们训练神经网络的方式打破了统计学每本教科书告诉你的所有规则?

[1:15:19] 统计学每本教科书都告诉你,如果你有 n 个数据点,你的参数就不应超过 n 个,因为你会疯狂地过拟合。你知道,你可能会正则化。如果你是贝叶斯主义者,你可能会引入先验。但是……(这是等价的)但你能有什么保证?而有了神经网络,神经网络是极度过参数化的。我们经常用数亿个参数训练神经网络。它们被用于生产环境。而训练样本的数量远不及此。这怎么行得通?

[1:15:53] 但它确实有效!好,那么今天我们用深度学习能做的事情:你知道,我们可以有更安全的汽车;我们可以有更好的医学分析、医学图像分析系统;我们可以有相当不错的语言翻译,远非完美,但有用;愚蠢的聊天机器人;你知道,非常好的信息搜索检索和过滤。如今谷歌和脸书完全围绕深度学习构建。你把深度学习从它们那里拿走,它们就会崩溃。

[1:16:27] 而且,你知道,在能源管理和生产领域有大量应用,还有各种各样的东西;制造业、环境保护。但我们并没有真正智能的机器。我们没有具备常识的机器。我们没有智能个人助理。我们没有,你知道,智能聊天机器人。我们没有家用机器人。你知道,我的意思是,有很多事情我们不知道怎么做,对吧。这就是为什么我们还在做研究。好,所以,深度学习实际上是关于学习表征。但真正来说,我们应该事先知道表征是什么。所以我谈到了模式识别的传统模型。

[1:17:04] 但是……表征实际上是关于,你知道,你有你的原始数据,你想把它转换成某种有用的形式。理想情况下,你希望把它转换成一种无论你想用它做什么都有用的形式。某种普遍意义上的“有用”。好,而且这到底意味着什么并不完全清楚。但至少,你想把它转换成一种对你所设想的任务有用的表征。几十年来,关于以某种方式预处理自然数据从而产生良好表征的通用方法,有很多想法。

[1:17:54] 我不打算详细讲这一长串清单。但像统计空间、做随机投影这样的事情。所以随机投影实际上有点像一种怪物,它周期性地冒出来,比如每五年一次。每次它冒出来,你都得敲它的头。这就是感知机背后的想法。所以感知机的第一层是随机投影层。那是什么意思?随机投影是一个随机矩阵,你知道,它的输出维度比输入维度小,最后带有某种非线性,对吧。所以想想一个带非线性的单层神经网络,但权重是随机的。

[1:18:38] 所以你可以把这看作随机投影。很多人周期性地重新发现这个轮子,声称它很棒,因为你不需要做多层训练。所以它始于感知机,然后你知道它在60年代又回来了,然后在1980年代又回来了,然后又回来了。现在它又回来了。有一整个社区,主要在亚洲。他们把第一层是随机的两层神经网络称为“极限学习机”,好。

[1:19:12] 这就像,很荒谬,但它确实存在。它们并不“极端”,我是说它们极其愚蠢,但是——你懂的。对,所以我刚才提到了世界的组合性。就是,从像素到边缘到纹理基元、图案、部件、物体。在文本中你有字符、词、词组、从句、句子、故事。在语音中也是一样,你有单个采样。你有,你知道的,频带、声音、音素、音位、词,等等。

[1:19:49] 你总是有这种层级结构。好,那么这里有很多试图否定整个深度学习理念的尝试。好,首先,第一点。这些是我几十年来听到的东西,好——主要来自理论家,但很多人也这么说,你必须了解它们,因为五年后当人们说“哦,深度学习很烂”的时候它们还会回来。为什么不用支持向量机呢?好,那么,左上角这里就是支持向量机。支持向量机是一个,我相信你们很多人都听说过核机器和支持向量机。

[1:20:22] 谁知道这是什么?我是说,哪怕只是大概知道这是什么。好,有几个人举手。谁完全不知道支持向量机是什么?别害羞。对。对,不知道也没关系。好,就像大多数人两个都没举手。[Alfredo:请举手,谁知道支持向量机。] 好,来,举高一点。酷,好的。谁完全不知道它是什么?别害羞,没关系。[Alfredo:听不清] 好,很好。

[1:20:55] 对,那么这就是支持向量机。支持向量机是一个两层神经网络。它其实不算是神经网络,人们不喜欢这样表述,但你真的可以这样理解。它是一个两层神经网络,其中第一层,用这里的函数 K 表示,第一层的每个单元将输入向量 X 与某个训练样本 X^i 进行比较。好,所以你取你的训练样本,假设你有一千个——那么你有一千个 X^i,从 i = 1 到 1,000,然后你有一个函数 K 来比较 X 和 X^i。

[1:21:26] 比较两者的一个好函数例子是,你取 X 和 X^i 之间的点积,然后把结果通过类似指数负平方之类的函数。这样你就得到一个高斯响应,作为 X 和 X^i 之间距离的函数,好。所以这是一种比较两个向量的方式,具体是什么无所谓。然后,你取这个 K 函数比较输入与每个样本后输出的那些分数,并计算它们的加权和。你要学习的就是这些权重,也就是 alpha。

[1:21:59] 好,所以它是一个两层神经网络,其中第二层可训练,第一层固定。但某种程度上,你可以把第一层看作是以无监督方式训练的,因为它使用了训练集的数据,但只用了 X,没用 Y。它以一种你能想象到的最笨的方式使用数据,也就是存储每一个 X,并把每一个 X 都当作一个神经元的权重(如果你愿意这么说的话)。好,这就是支持向量机。你可以就它背后那些精巧的数学写一本上千页的书。但归根结底,它是一个两层神经网络,第一层以非常笨的无监督方式训练,第二层只是一个线性分类器。

[1:22:44] 所以,它基本上就是美其名曰的模板匹配,因为它基本上是把输入向量与所有训练样本进行比较。因此,如果你想用原始图像做计算机视觉之类的事情,它就不管用了。如果 X 是一张图像,而 X^i 是来自 ImageNet 的一百万张图像——首先,对每张图像你都得与一百万张图像进行比较,或者如果你够聪明、训练方式得当的话,也许能少一点,那会非常昂贵,而且你所做的这种比较基本上就是解决问题的关键。你最终得到的加权和其实只是锦上添花。

[1:23:24] 其实我用那个类比用得太频繁了。所以……你可以近似,你可以有定理证明,通过调整核函数和 alpha,你可以任意接近地近似任何你想要的函数。所以,如果你去和理论家谈,他们会告诉你:你为什么需要深度学习?我可以用核机器近似任何我想要的函数。那个求和中的项数可能非常多,而且没人告诉你该用什么核函数。所以,那并不能解决问题。

[1:24:01] 你可以用两层神经网络,好。所以这就是右上角这个。第一层是对矩阵 W^0 与输入向量的乘积施加非线性函数 F;然后第二层乘以第二个矩阵;然后再让它通过另一个非线性。好,所以这是两个线性和非线性操作的复合。同样,你可以证明在某些条件下,用类似这样的东西可以近似任何你想要的函数,前提是中间有一个足够大的向量。

[1:24:31] 好,那么第一层输出的维度,如果它足够高——可能是无限的——你可以通过让这一层趋于无限,来任意逼近你想要的任何函数。所以再说一遍,你去跟理论家聊,他们会告诉你:为什么需要多层?我用两层就能逼近任何我想要的东西。但有一种论点认为,用两层来做可能非常非常昂贵。而且……

[1:25:03] 对你们中的一些人来说,这听起来可能很熟悉。对大多数人来说可能不是。假设我想设计一个逻辑电路。好,那么,当你设计逻辑电路时,对吧,你有与门、或门,还有……或者与非门,对吧。你只用与非门就能做所有事情,对吧,即负与。而且如果你……你可以证明,任何布尔函数都可以写成一堆或运算作用在一堆……你知道,一堆与运算上,然后在这之上再做一个或运算。这叫做析取范式(DNF)。

[1:25:36] 所以任何函数都可以用两层写出来。问题在于,对大多数函数来说,中间所需的项数相对于输入规模是指数级的。所以,举个例子,如果我给你 N 个比特,让你构造一个电路,告诉我输入串中打开的比特数是偶数还是奇数。好,这是一个简单的布尔函数:输出为 1 或 0。如果你用两层来做,中间所需的门数本质上是指数级的。

[1:26:09] 如果你允许自己用 log(N) 层来做,其中 N 是输入比特数,那么它就是线性的。好。所以如果你允许自己使用多层,你就从指数复杂度变成了线性复杂度。这就好像,你知道,当你写程序时——我跟你说。以这样一种方式写程序。运行你的程序只需要两个顺序步骤。所以基本上你的程序只有两条顺序指令。你的程序里可以有、可以运行任意多条指令。但它们中的大多数必须并行运行。而你只允许有两个顺序步骤。

[1:26:52] 好。而且,你能使用的指令类型是诸如,你知道,线性组合、非线性——之类简单的东西,对吧。不是整个子程序那种。所以对大多数、大多数问题来说,你在第一步中需要计算的中间值的数量。相对于输入规模将是指数级的。只有极少数问题,你才能用非指数数量的最小项来应付过去。

[1:27:25] 但如果你允许程序按顺序执行多个步骤,那么突然间,你知道,它就可以简单得多。它会运行得更慢,但会占用少得多的内存。它会占用少得多的东西——资源。所以设计计算机电路的人知道这一点,对吧。例如,你可以设计一个将两个二进制数相加的电路。有一种非常简单的方法可以做到这一点,就是你先取前两位,将它们相加,然后在第二位、第二对位上传播进位,你知道,把进位考虑进去,就得到结果的第二位,然后再进位,你知道,传播进位,然后你按顺序做这件事,对吧。

[1:28:02] 所以问题在于,它所花的时间与你试图相加的数字的大小成正比。所以电路设计者有一种方法,基本上就是预先计算进位,叫做进位前瞻,这样完成一次加法所需的步骤数实际上不是 N,而是远小于那个数。好。但那是以电路复杂度大幅增加为代价的。就是那个数量,比如它在芯片上占用的面积。所以这种时间与空间之间,或者说深度与……之间的交换,

[1:28:42] 而且,某种程度上,时间是已知的。那么我们称什么为深度模型呢?所以,你知道,一个两层的神经网络,也就是有一个隐藏层的网络,我不会称它为“深度”的,尽管从技术上讲它使用了反向传播。但是,呃,你知道,它并没有真正学到复杂的表示。所以深度学习中存在这种层次结构的思想。支持向量机绝对不是深度的。除非你学习复杂的核,但那样它们就不再是支持向量机了。那么什么是好的特征?什么是好的表示?

[1:29:20] 所以,这里有一个我喜欢的例子。有一个东西叫做流形假设,它说的是自然数据——所以,如果我用一台分辨率为 1,000 x 1,000 像素的相机拍下这个房间的照片。那就是 1 百万像素、3 百万个值。你可以把它看作一个具有 3 百万个分量的向量。在所有具有 3 百万个分量的可能向量中,有多少对应于我们所说的自然图像?

[1:29:54] 当我们看到一张图片时,我们能判断出它是自然图像还是非自然图像。我们的视觉系统中有一个模型,会告诉我们这看起来像一张真实的图像。我们也能判断出它什么时候不是。因此,那些真正被我们视为自然图像的像素组合,在所有可能图像的集合中只占一个极其极其极其极其极其微小的子集。将随机像素组合成毫无意义的图像的方式,远远多于将像素组合成看起来像自然图像的方式。

[1:30:27] 所以流形假设是说,那些在我们看来显得自然的事物集合,位于高维环境空间中的一个低维曲面上。一个能让你信服的好例子:想象我拍了很多一个人做鬼脸的照片,对吧。这个人站在白色背景前。她的头发不动。她大致地转动头部,做出各种表情等等。那个人的所有图像的集合——也就是我拍了一段那个人的长视频——那个人的所有图像的集合位于一个低维曲面上。

[1:31:07] 所以我想问你们的一个问题是,那个曲面的维度是多少?不管数量级多大,都可以。有谁,请说?[学生评论听不清。] 对,你们可能以前听过我这套说辞,但是……[发言者:那个人说了什么?] 嗯?[发言者:他们说了什么?] 好,那么对于还没听过这个的人,你们有机会,再给一次回答的机会。好,有谁猜一下?

[1:31:41] 没有吗?别害羞。我想要多个提议。任何人都行。你们可以低头看笔记本电脑,但是,你知道,我可以点你或者什么的。好,有什么想法吗?请说。

[1:32:11] 没想法?没关系。你,有什么想法吗?也许你听到了他说的。[学生评论听不清。] 线性的,那是什么意思?[学生评论听不清。] 那是一个1维空间。好,一个一维子空间。好,还有其他提议吗?有什么想法吗?好,我拍的图像是一百万像素。好,所以环境空间是3百万维。

[1:32:52] [学生评论听不清] 它们不变,不。而且这个人可以移动头部,你知道,转来转去,诸如此类。但并不是真的移动整个身体。我的意思是,你只看到脸,它基本在中央。[学生:一千。] 一千,好。为什么?[学生评论听不清。]

[1:33:23] 好,是的,这个猜测不错。至少动机是对的。[学生评论听不清。] 再说一遍。[学生:人的表面积。] 人的表面积。对。所以它受限于该人所占据的像素数量。这是肯定的。这是一个上界。是的。当然,那些像素不会取所有可能的值。所以这是一个很宽泛的上界。还有别的想法吗?好。所以基本上,正如你所说,它的维度受限于人脸上的肌肉数量。

[1:34:03] 对。你观察到的那个人身上的自由度数量,就是其脸上的肌肉数量。可独立运动的肌肉数量,对吧。所以有 3 个自由度,因为你可以这样、那样或那样歪头。那就是 3,就在那里。然后是平移,这样、那样。也许这样和那样,也许向上或向下。那就是 6。然后是脸上的肌肉数量,对吧。所以你可以微笑。你可以,你知道,撅嘴。你可以做各种动作,对吧。而且你可以独立地做这些。你闭上一只眼。

[1:34:46] 你可以朝一个方向微笑,你知道,我是说……所以,无论你有多少独立肌肉——不算舌头,因为舌头上有大量肌肉。那大约是 50。也许还多一点。所以,无论如何,它小于 100。好,那么局部来看,如果你想参数化所有这些图片所占据的曲面——从一张图片移动到另一张——它是一个曲面,其参数少于 100 个,用来确定该曲面上一个点的位置。当然,它是一个高度非线性的曲面。

[1:35:21] 它不像这里这个漂亮的卡拉比-丘流形,但它仍然是一个曲面。当然答案就在幻灯片里,所以,你知道。所以你希望的是一个理想的特征提取器,能够 disentangle 你所观察到的事物的可解释变化因素。对吧。所以我脸上的不同方面,你知道,不只是我移动肌肉、转动头部——其中每一个都是独立的变化因素。再说一次,我还可以摘掉眼镜。

[1:35:53] 你知道,光照可能会变化。那是另一组,你知道,变量——变量。而你希望的是一个基本上能分别表示每一个变化因素的表示。所以如果在学习良好表示时要满足一个标准,那就是:找到你所观察数据的独立可解释变化因素。而底线是,没有人知道该怎么做。好。但那将是表示学习的终极目标。

[1:36:32] 我们基本上到结尾了。好。如果还有问题,我再回答两个。是的。[学生提问,听不清。] 好,那么问题是:有没有类似 PCA 这样的预处理方法能找到那些向量?是的,如果流形是线性的,PCA 就能找到它们。所以,如果你假设所有这些示例或人脸占据的表面是一个平面,那么 PCA 就能找到那个平面的维度——主成分分析,对吧。

[1:37:18] 但是,不幸的是,它不是线性的,对吧。让我……是的,让我给你举个例子。如果你把我和我那个长得像我的大儿子,让我们摆出同样的表情、同样的姿势,我们图像之间的距离会相对较小,尽管我们不是同一个人。现在,如果你把我的脸和我平移了 20 个像素的脸相比,我和平移后的我自己之间的距离,比我和我儿子之间的距离还要大,对吧。

[1:37:53] 所以……这意味着,你知道,我脸的流形在那个空间里是某种复杂的流形。我儿子是一个略有不同的流形,与我的流形不相交。然而这两个流形彼此非常接近,它们彼此之间的距离,比我的流形上任意两个样本之间、以及他的流形上任意两个样本之间的距离都要近。所以 PCA 基本上不会告诉你任何东西。好,这是那个表面不是平面的另一个原因。

[1:38:26] 你现在正看着我。现在想象那个流形,一个线性流形,一维流形,就是我完全转过头 360 的过程。好。那个流形在拓扑上等同于一个圆。它不是平的。不可能是,它不可能被对齐。所以 PCA 找不到它。好,我得赶紧走了。谢谢!下周见。

查看英文原始字幕

[0:00] OK, so first of all I have a terrible confession to make. This class is actually being run not by me, but by these two guys: Alfredo Canziani and Mark Goldstein, whose names are here [points to slide]. They are the TA'S and you'll talk to them much more often than you'll talk to me. That's the first thing. The other confession I have to make is that if you have questions about this class, don't ask them at the end of this course because I have to run right after the class to catch an airplane. But that can wait until next week. OK, so let's start right in.

[0:35] Some very basic course information. There is a website as you can see. I will do what I can to post the PDF of the slides on the website. Probably just before the lecture, probably just a few minutes before the lecture, usually. But, but it should be there by the time you get to class, or at least by the time I get to class. There's going to be nine lectures that I'm going to teach, on Monday evenings. There is also a practical session every Tuesday night that further on Mark will be running. So, they'll go through some of the, you know, practical questions. Some, you know, refreshers on sort of math, you know mathematics that are necessary for this, and basic concepts. Some tutorials on how to use PyTorch and various other software tools.

[1:24] And there's going to be three guest lectures. The names of the guest lectures are not finalized. But it's gonna be on topics like natural language processing, computer vision, self-supervised learning, things like that. There's going to be a midterm exam, or at least we think there is. And it's going to take one of those sessions, you know, around March. And the evaluation will be done on the midterm and on a final project.

[1:58] And, you can sort of, you know, band in groups of two. Did we say two or three, or just two? We didn't decide yet, we'll see. The project will probably have to do with a combination of self-supervised learning and autonomous driving. We are discussing with various people for data and things like that. Okay, let me talk a little bit about, so this first lecture is really going to be sort of a broad introduction about what deep running is really, and what it can do and what it cannot do.

[2:33] So it will serve as an introduction to the entire thing. So, we'll go through the entire arc, if you want, of the class but in, sort of, very superficial terms so that you get, sort of, broad high-level idea of all the topics we're talking about. And whenever I'll talk about a particular topic you'll see where it fits in this kind of whole picture. But before that... So, there is a prerequisite for the class which is, you know: You need to be kind of familiar with machine learning or at least basic concepts in machine learning.

[3:04] Who here has played with PyTorch, TensorFlow, has trained a neural net? OK. Who has not done that? Don't be shy, OK. OK? So the majority has. Which is good. But I'm not going to assume that you know everything about this. Particularly, I am not going to assume that you know a lot of the, you know, sort of deep underlying techniques. OK, so here is the course plan and depending on what you tell me I can adjust this and sort of, you know, go faster on certain sections that you think are too obvious because you've played with this before, or other things.

[3:52] So intro to Supervised Learning, Neural Nets, Deep Learning. That's what I'm going to talk about today. What deep learning can do, what it cannot do, what are good features. Deep learning is about learning representations. That's what I'm going to talk about. Next week will be about back propagation and basic architectural components. So things like the fact that you build neural nets out of modules that you connect with each other. Then you compute gradients you get automatic differentiations. And then these various types of architectures, loss functions, activation functions — you know different modules. Tricks like weight sharing and weight tying, multiplicative interactions, attention gating — things like this, right.

[4:33] And then particular macro architectures, like mixture of experts, Siamese net, hyper networks, etc. So we'll dive pretty quickly in and that's appropriate if you've already played with some of those things. Then there will be either one or two lectures – I haven't completely decided yet — about convolutional nets and their applications. One of them might end up being a guest lecture. Then, more specifically, about deep learning architectures that are useful in special cases.

[5:06] So things like recurrent neural nets with back propagation through time, which is the way you train recurrent neural nets. And ... ... and sort of ... ... applications of ... recurrent neural nets to things like control and, you know, producing time series and stuff like that. Then things like combine recurrence and gating and multiplicative interactions like gated recurrent units and LSTM. And then things that really use multiplicative interactions as kind of really a basis of their architecture like memory networks, transformers, adapters, etc., which are sort of very recent architectures that have become extremely popular and in things like NLP and other other areas. And then a little bit about graph neural nets, which I'm not going to talk about this a lot because there is another course that you can take by Joan Bruna where he spends a lot of time on graph neural nets.

[6:06] Then... then we'll talk about how we get those deep learning systems to work. And, so, various tricks to get them to work. Sort of understanding the type of optimization that takes place in neural nets. So... ...the type of... you know, we... we use, of course — learning is always about, almost always about, optimization. And deep learning is almost always about gradient-based optimization. And there are certain rules about optimization in the convex case that are well understood.

[6:40] But they're not well understood when the training is stochastic, which is the case for most deep learning systems. And they're not very well understood also in deep learning, because the the cost function is not ... is not convex. It has local minima, and saddle points, and things like this. So it's important to understand the geometry of the objective function. I say it's important to understand but the the big secret here is that nobody actually understands. So ... it's important to understand that nobody understands. Okay? But there are a few tricks that have come up through a combination of intuition and a little bit of theoretical analysis and empirical search. Things like initialization tricks, normalization tricks, and regularization tricks like drop out.

[7:29] (Grading clipping is more for optimization.) Things like momentum, average HDD, the various methods for parallelizing HDD. Many of which do not work. And then something a little exotic called target prop and the Lagrangian formulation of back prop. Then I'll switch to my favorite topic, which is energy-based models. So this is sort of a general formulation of a lot of different, sort of, approaches to learning — whether they are supervised, unsupervised, self-supervised. And whether they involve things like inference.

[8:04] Like, you know, searching for the value of variables that nobody tells you the value of, but that your process your system is supposed to infer. So that could be thought of as sort of a way of implementing reasoning with neural nets. So you could think of reasoning in neural nets as a process by which you have some energy function that's being optimized with respect to some variables. And the value you get as a result of this optimization is the value of those variables you were trying to find. And so, there is sort of the the common view that a neural net is just a function that computes its output as a function of its input. So you just run through the neural net, you get an output.

[8:43] But that's a fairly restrictive form of inference in the sense that you can only produce one output for a given input. But very often there are multiple possible answers to a given input. And so, how do you, kind of, represent problems of this type where there are multiple answers, multiple possible answers, to a given input? And one answer to this is: You make those answers the minima of some energy function, and your inference algorithm is going to find values of those variables that minimize this objective function. And there might be multiple minima. So that means your model might produce multiple outputs for a given input. Okay?

[9:21] So, energy-based models, it's kind of a way of doing this. A special case of those energy-based models are probabilistic models: like, you know Bayesian methods, graphical model, Bayesian nets and things like this. Energy methods are a little more general. So a little less specific. So special cases of this include things like what people used to call structure prediction. And then there is a lot of applications of this in what's called self-supervised learning. And that will be the topic of the next couple lectures. So self-supervised learning is a very very active topic of research today.

[9:57] And probably something that's going to become really dominant in the future. It's already ... ... in the space of a year, it's become dominant in natural language processing. And, in the last few months, just three months there's been a few papers that show that self-supervised learning methods actually work really well in things like computer vision as well. And so my guess, my guess is that ... self-supervised learning is going to take over the world in the next few years. So, I think it's useful to hear about it in this class. The things like — I'm not going to go through a laundry list of this — but there are things that you may have heard of: like variational auto-encoders, de-noising auto-encoders, BERT, which is, you know, those transformer architectures that are trained for natural language processing. They are trained with self-supervised learning and they are a special case of a de-noising auto-encoder.

[10:45] So a lot of those things you may have heard of without realizing they were all, kind of — it can be all understood in the context of this sort of energy-based approach. And that includes also generatative adversarial networks (GANs), which I'm sure many of you have heard of. And then there is self-supervised learning and beyond. So, you know, how do we get machines to really kind of become really intelligent? They're not superintelligent. They're not very intelligent right now. They can solve very narrow problems very well, sometimes with superhuman performance. But no machine has any kind of common sense. And, the most intelligent machines that we have probably have less common sense than a house cat. So, how do we get to cat-level intelligence first, and then maybe human-level intelligence?

[11:29] And, I don't pretend to have the answer, but I have, you know — a few ideas that are interesting to discuss in the context of self-supervised learning, there. I've had some applications. Any questions? So that's the plan of the course. Okay. it might change, dynamically But, at least, that's the intent. Any questions? ...Okay... [Student Question: Will we also be having assignments in the course?] Yeah, yeah, there are assignments.

[12:00] [...Inaudible...] Okay, so for those of you who didn't hear Alfredo, because he didn't speak very loudly: The final project is actually going to be a competition between the teams. So there is going to be a leaderboard and everything. And, in preparation for this, the assignments will be basically practice to get familiar with all the techniques that you would need for deep learning in general, but for the final project in particular.

[12:46] [Also for the midterm.] Right, also for midterm, obviously. Okay, so most of you probably know that — and this is gonna probably be boring for some of you who've already played with those things — but let's start from the basics. Deep learning is inspired by what people have observed about the brain, but the inspiration is just an inspiration. It's not, the attempt is not to copy the brain because there's a lot of details about the brain that are irrelevant, and that we don't know if they are relevant actually to human intelligence. So the inspiration is at kind of the conceptual level.

[13:18] And, it's a little bit the same as, you know, airplanes being inspired by birds. But the underlying principles of flight for birds and airplanes are essentially the same, but the details are extremely different. They both have wings. They both generate lift by propelling themselves through air, but, you know, airplanes don't have feathers and don't flap their wings. So it's a bit of the same idea. And the history of this goes back to a field that has kind of almost disappeared, or, at least changed names now, called Cybernetics. If you want a specialist about the history of cybernetics, he is sitting right there: Joe Lemelin Can you raise your hand?

[13:57] So, Joe is actually philosopher. And he is interested in the — he actually has a seminar on, kind of, the history of AI. In the what department is this? [Joe: Media, Culture, and Communication.] Media, Culture, and Communication. So, not CS. He knows everything about, you know, the history of cybernetics. So it started in the 40's with two gentlemen: McCulloch and Pitts. Their picture is on the top right here. And they came up with the idea that, you know, people at the time were interested in logic, but neuroscience was a very sort of nascent field.

[14:32] And, they got the idea that if neurons are basically threshold units that are on or off, then by connecting neurons with each other, you can build Boolean circuits and you can basically do logical inference with neurons. So they say, you know: The brain is basically a logical inference machine because the neurons are binary. And this idea — So the idea was that a neuron computes a weighted sum of its inputs and then compares the weighted sum to a threshold. It turns on if it's above the threshold, turns off if it's below.

[15:05] Which is sort of simplified view of how real neurons work — a very, very simplified view. That model kind of stuck with the field for decades. Almost four decades. Actually, a full four decades. Then there was, you know, quasi-simultaneously Donald Hebb, who had the idea that neurons in the brain — it's an old idea that the brain learns by modifying the strength of the connections between the neurons that are called the synapses. And you had the idea of what's now called Hebbian learning, which is that if two neurons fire together, then the connection that links them increases. And if they don't fire together, maybe it decreases.

[15:50] That's not an idea for learning algorithm, but it's sort of a first idea, perhaps. And then cybernetics was proposed by this guy Norbert Wiener, who is here. [Bottom Right] This is the whole idea that by having systems that, kind of, have sensors and have actuators, you can have feedback loops and you can have, you know, self-regulating systems. And, what's the theory behind this? You know, we sort of take that for granted now. But the idea that you know, you have things, like kind of, for example: You know, you drive your car, right? You turn the wheel and there's a so-called PID controller that actually turns the wheel in proportion to how you turn the steering wheel.

[16:36] And it's a feedback mechanism that basically measures the position of the steering wheel, measures the position of the wheel of the car. And, then, if there is a difference between the two, kind of corrects the wheels of the car so that they match the orientation steering wheel. That's a feedback mechanism. That, the stability of this, and the rules about this basically all come initially from this work. That led to a gentleman by the name of Frank Rosenblatt to basically imagine learning algorithms that modified the weights of very simple neural nets. And what you see here at the bottom the two pictures here [Bottom Left]: This is Frank Rosenblatt, and this is the Perceptron. This was a physical analog computer. It was not a three-line Python program, which is what it is now.

[17:24] It was a gigantic machine with, you know, wires and optical sensors so you could show it pictures. It was very low resolution. And then it had — it had neurons that could compute a weighted sum, and the weights could be adapted. And the weights were potentiometers. The potentiometers had motors on them so they could rotate for the learning algorithm. So it was electro-mechanical. And what he's holding here in his hand is a module of eight weights with (you can count them), with those potentiometers, motorized potentiometers on them.

[18:02] Okay, so that was a little bit of history of where neural nets come from. Another interesting piece of history is that this whole idea of, sort of, trying to build intelligent machines by basically simulating networks of neurons was born in the 40's, kind of took off a little bit in the late-50's, and completely died in the 1960's, in the late-1960s when people realized that with the kind of learning algorithms and architectures that people were proposing at the time you couldn't do much. You know, you could do some basic, very simple pattern recognition, but you couldn't do much.

[18:36] So between 1969, roughly, and — or 1968 — and 1984, I would say, basically, nobody in the world was working on neural nets except a few kind of isolated researchers mostly in Japan. Japan is its own, kind of, relatively isolated ecosystem for funding research. People don't listen to the same kind of ... ... fashions, if you want. And then the field took off again in 1985, roughly, with the emergence of backpropagation [backprop]. So backpropagation is an algorithm for training multi-layer neural nets, as many of you know.

[19:20] People were looking for something like this in the 60's and basically didn't find it. And the reason they didn't find it was because they had the wrong neurons. They were using McCulloch-Pitts neurons that are binary. The way to get backpropagation to work is to use an activation function that is continuous, differentiable, or at least, continuous. And people just didn't have ... you know, the idea of using continuous neurons. And so, they didn't think that you could train those systems with gradient descent, because things were not differentiable.

[19:56] Now there's another reason for this, which is that if you have a neural net with binary neurons, you never need to compute multiplications. You never need to multiply two numbers. You only need to add numbers, right. If your neuron is active, you just add the weight to the weighted sum. If it is inactive, you don't do anything. If you have continuous neurons, you need to multiply the activation of a neuron by a weight to get a contribution to the weighted sum. It turns out, before the 1980's, multiplying two numbers, particularly floating point numbers, on any sort of non-ridiculously expensive computer was extremely slow. And so there was an incentive to not use continuous neurons for that reason.

[20:34] So the reason why backprop didn't emerge earlier than the mid 80's is because that's when, you know, computers became fast enough to do floating point multiplications, pretty much. People didn't think of it this way, but that's, you know, kind of retrospectively, that's pretty much what happened. So, there was a wave of interest in neural nets between 1985 and 1995 — lasted about 10 years. In 1995, it died again. People in machine learning basically abandoned the idea of using neural nets.

[21:05] (For reasons that I'm not gonna go into right now.) And that lasted until the late 2000's, early 2010. So, when around 2009/2010 people realized that you could use multi-layer neural nets, training with backprop, and get an improvement for speech recognition. It didn't start with ImageNet. It started with speech recognition, around 2010. And within 18 months of the first papers being published on this, every major player in speech recognition had deployed commercial speech recognition systems that use neural nets. So, if you had an Android phone and you were using any other speech recognition features in an Android phone around 2012 that used neural nets. That was probably the first really, really wide deployment of, kind of, modern forms of deep learning, if you want.

[21:55] Then at the end of 2012 / early-2013, the same thing happened in computer vision, where the computer vision community realized deep learning, convolutional nets in particular, work much better than whatever it is that they were using before, and started to switch to using commercial nets, and basically abandoned all previous techniques. So that created a second revolution, now in computer vision. And then three years later, around 2016 or so, the same thing happened in natural language processing — in language translation, and things like this: 2015/16.

[22:28] And, now we're going to see — it's not happened yet — but we're going to see the same revolution occur in things like robotics, and control, and, you know, a whole bunch of application areas. But let me get to this: Okay. So, you all know what supervised learning is, I'm sure. And this is really what the vast majority — and not the vast majority — 90-some percent applications of deep learning use supervised learning as kind of the main thing. So supervised learning is the process by which you collect a bunch of pairs of inputs and outputs of examples of, let's say, images together with a category (if you want to do image recognition). Or a bunch of audio clips with their text transcription: a bunch of text in one language with the transcription in another language, etc.

[23:22] and you feed one example to the machine. It produces an output. If the output is correct you don't do anything, or you don't do much. If the output is incorrect then you tweak the parameters of the machine. (Think of it as a parametrized function of some kind.) And you tweak the parameters of that function in such a way that the output gets closer to the when you want. Okay. This is in non-technical terms what supervised learning is all about. Show a picture of a car, if the system doesn't say car, tweak the parameters. The parameters in the neural net are going to be the weights, you know, that compute weighted sums in those simulated neurons.

[24:03] tweak the knobs so that the output gets closer to the one you want. The trick in neural nets is: How do you figure out in which direction and by how much to tweak the knobs so that the output gets closer to the one you want? That's what gradient computation and backpropagation is about. But before we get to this, a little bit of history again. So there was a flurry of models, basic models for classification. You know, starting with the Perceptron, there was another competing model called the Adaline, which is on the top right here. They are based on the same kind of basic architectures: compute the weighted sum of inputs compared to a threshold. If it's above the threshold, turn on. if it's below the threshold, turn off.

[24:45] What you see, the Adaline here, the thing that Bernie Widrow is tweaking is actually a physical analog computer again. So it's like the Perceptron, it was much less, you know, much smaller, in many ways. The reason I tell you about this is that the the Perception actually was a two layer neural net, a two layer neural net in which the second layer was trainable with adaptive weights. But the first layer was fixed. In fact, most of the time with most experiments it was, It was determined randomly. You would, like, randomly connect input pixels of an image to neurons that would, you know, be threshold neurons with random weights, essentially.

[25:27] This is what they called the associative layer. And that basically became the basis for the sort of conceptual design of a pattern recognition system for the next four decades. I want to say four decades. Yeah, pretty much. So, that model is one by which you take an input, you run it through a feature extractor that is supposed to extract the relevant characteristics of the input that will be useful for the task.

[26:01] So, you want to recognize a face? Can you detect an eye? How do you detect an eye? Well, there is probably a dark circle somewhere. Things like that, right? You want to recognize a car, you know. Well, they are kind of dark, round things, etc. So, the problem here — and so, what this feature extractor produces is a vector of features, which are things that may be numbers, or they may be on or off. Okay, so it's just a list of numbers, a vector. And you're going to feed that vector to trainable classifier. In the case of Perceptron or a simple neural net, it's gonna be just the system that computes a weighted sum, compares it to a threshold.

[26:41] The problem is that you have to engineer the feature extractor. So the entire literature of pattern recognition (statistical pattern recognition at least) and a lot of computer vision (at least the part of computer vision that's interested in recognition) was focused on this part: the feature extractor. How do you design a feature extractor for a particular problem? You want to do, I don't know, Hangul character recognition. What are the relevant features for recognizing Hangul? And how can you extract them using all kinds of algorithmic tricks? How do you pre-process the images? You know, how do you normalize their size? You know, things like that.

[27:16] How do you skeletonize them? How do you segment them from their background? So the entire literature was devoted to this [Feature Extractor], very very little was devoted to that [Trainable Classifier]. And what deep learning brought to the table is this idea that instead of having this kind of two-stage process for pattern recognition, where one stage is built by hand, where the representation of the input is the result of, you know, some hand-engineered program, essentially.

[27:48] The idea of deep learning is that you learn the entire task end-to-end. Okay, so basically you build your pattern recognition system, or whatever it is that you want to do with it as a cascade or a sequence of modules. All of those modules have tunable parameters. All of them have some sort of nonlinearity in them. And then you stack them, you stack multiple layers of them, which is why it's called deep learning. So the only reason for the "deep" word in deep learning is the fact that there are multiple layers. There is nothing more to that.

[28:20] And then you train the entire thing end-to-end. So the complication here, of course, is the fact that the parameters that are in the first box: How do you know how to tune them so that the output does— you know, goes closer to the output you want? That's what backpropagation does for you. Okay, why do all those modules have to be nonlinear? It's because, if you have two successive modules, and they're both linear, you can collapse them into a single linear. Right, the product of two linear functions, or the composition of two linear functions is a linear function. Take a vector multiply by a matrix and then multiply it by a second matrix.

[28:59] It's as if you had pre-computed the product of those two matrices, and then multiplied the input vector by that composite matrix. So there's no point having multiple layers if those layers are linear. Okay, there's actually a point, but it's a minor point. So, since they have to be nonlinear, what is the simplest multi-layer architecture you can imagine that has arameters that you can tune — things like weights in the neural nets — and is non-linear?

[29:38] And you realize quickly that it has to look something like this: So ... Take an input. An input can be represented as a vector, right. An image is just a list of numbers. Think of it as a vector, ignore the fact that it's an image for now. Piece of audio, whatever it is that your sensors or your data set gives you, is a vector. Multiply this vector by a matrix. The coefficients in this matrix are the tunable parameters. And then take the resulting vector, right — when you multiply a matrix by a vector, you get a vector.

[30:15] Pass each component of this vector through a nonlinear function. And, if you want to have the simplest possible nonlinear function, use something like what's shown at the top here [ReLU(x) = max(x, 0)], which people in neural nets call the ReLU; people in engineering call this half wave rectification; people in math call this positive part. Whatever you want to call it, okay. So, apply this nonlinear function to every component of the vector that results from multiplying the input vector by the matrix.

[30:47] Okay. Now you get a new vector, which has lots of zeros in it, because whenever the weighted sum was less than zero, the output is zero, if you pass through the ReLU. And then repeat the process: Take that vector, multiply it by a weight matrix; pass the result through point wise non-linearity; take the result, pass it — multiplied by a matrix — pass the result through nonlinearities. That's a basic neural net, essentially. Okay now Why is that called a neural net at all? It's because when you take a vector and you multiply a vector by a matrix, to compute each component of the output, you actually compute a weighted sum of the components of the input by a corresponding row in the matrix, right. So this little symbol here — there's a bunch of components of the vector coming into this layer. And, you take a row of the matrix, compute a weighted sum of those values where the weights are the

[31:51] values in the row of that matrix, and that gives you a weighted sum. And you do this for every row that gives you the result, right. So, the number of units after the multiplication by a matrix is going to be equal to the number of rows of your matrix. And the number of columns of the matrix, of course has to be equal to the size of the input. Okay. So supervised learning — in slightly more formal terms than the one I showed earlier — is the idea by which you're going to compare the output that the system produces...

[32:26] So, right, you show an input, you run through the neural net, you get an output. You're going to compare this output with a target output. And you are going to have an objective function, a loss module, that computes a distance, a discrepancy, penalty — whatever you want to call it. Divergence — okay, there's various names for it. And then you're going to compute the average of that. So the output of this cost function is a scalar, right.

[32:56] It computes the distance, for example, Euclidean distance between a target vector and the vector that the neural net produces, the deep learning system system produces. And then you can compute the average of this cost function, which is just a scalar You're going to average it over a training set, right. So, a training set is composed of a bunch of pairs of inputs and outputs; compute the average of this over the training set. The function you want to minimize with respect to the parameters of the system (the tunable knobs) is that average. Okay. So, you want to find the value of the parameters that minimizes the average error between the output you want and the output you get, averaged over a training set of samples.

[33:47] So... I'm sure the vast majority of people here, sort of, have at least an intuitive understanding of what gradient descent is. So, basically, the way to minimize this is to compute the gradient, right. It's like you are in a mountain, you're lost in the mountain (and it's a very smooth mountain), but there is fog and it's night, and you want to go to the village in the valley. And so, the best thing you can do is you turn around and you see which way is down, and you take a step down in the direction of steepest descent.

[34:22] Okay. So, this search for the direction that goes down: that's called "computing a gradient" or, technically, a negative gradient. Okay, then you take a step down. That's taking a step down in the direction of negative gradient. And if you keep doing this and your steps are small enough — small enough so that when you take a step, you don't jump to the other side of the mountain — then eventually you're going to converge to the valley, if the valley is convex. Which means that if there is no, kind of, lake, no mountain lakes in the middle where, you know, there's kind of a minimum and you're going to get stuck in that minimum the valley might be lower, but you don't see it.

[35:03] Okay. So that's why convexity is important as a concept. But here is another concept, which is the concept of stochastic gradient, which I'm sure again a lot of you have heard [of]. I'll come back to that in more detail. The objective function you're computing is an average over many many samples. You can compute the objective function in its gradient over the entire training set by averaging the the value of the entire training set.

[35:37] But it turns out it is more efficient to just take one sample or a small group of samples, computing the error that this sample makes, then computing the gradient of that error with respect to the parameters and taking a step. A small step. Then a new sample comes in — you're going to get another value for the error and another value for the gradient, which may be in a different direction because it's a different sample. And take a step in that direction. And if you keep doing this, you're gonna go down the the cost surface but in kind of a noisy way — there's going to be a lot of fluctuations.

[36:16] So what is shown here is an example of this. This is stochastic gradient applied to a very simple problem with two dimensions where you only have two weights. And it looks kind of semi-periodic because the examples are always shown in the same order, which is not what you're supposed to do with stochastic gradient. But as you can see the path is really erratic. Why do people use this? There's various reasons. One reason is that, empirically it converges much, much faster, particularly if you have a very large training set. And the other reason is that you actually get better generalization in the end. So if you measure the performance of the system on a separate set that you — I assume you all know the concepts of "training set" and "test set" and "validation set" but — So if you test the performance of the system on a different set, you get generally better generalization if you use stochastic gradient than if you actually use the real, true gradient descent.

[37:05] The problem is... yes [inaudible student question] No. It's worse. So computing the entire gradient of the entire dataset — It is computationally feasible. I mean you can do it. It's not any more expensive than... ...you know... [inaudible student comment] It'll be less noisy but it will be slower. So let me tell you why: I mean, this is something we're gonna talk about again when we talk about optimization.

[37:37] But let me tell you: I give you a training set with a million training samples. It's actually 100 repetitions of the same training sample with 10,000 samples. Okay. So my actual sample is 10,000 training samples. I replicate it 100 times and I claim that, you know, I scrambled it. I tell you here is my training set with a million training samples. So if you do a full gradient, you're going to compute the same values a hundred times. You're gonna spend a hundred times more work than necessary.

[38:09] Without knowing it. Okay. So this only works because of repetition. But it also works in, kind of, more normal situations in machine learning where you have samples that are, have a lot of redundancy in them, like very many samples are very similar to each other, etc. So if there is any kind of coherence — if your system is capable of generalization, then that means stochastic gradient is going to be more efficient because if you don't stochastic gradient, you're not going to be able to take advantage of that redundancy. So that's one case where noise is good for you.

[38:46] Okay. Don't pay attention to the formula. Don't get scared because we're going to come back to this in more detail. But, why is backpropagation called backpropagation? Again, this is very informal. It's basically a practical application of Chain Rule. So you can think of a neural net of the type that I showed you earlier as a bunch of modules that are stacked on top of each other. And you can think of this as compositions of functions. And you all know the basic rule of calculus. You know, how do you compute the derivative of a function composed with another function?

[39:22] Well the derivative of, you know, F composed with G is the derivative of F at the point of G of X, multiplied by the derivative of G at the point X. Right. So you get the product of the two derivatives. So this is the same thing except that the functions, instead of being scalar functions, are vector functions. They get vectors as inputs and the previous vectors as outputs. More generally, actually, they take multi-dimensional arrays as input and multi-dimensional arrays as output, but that doesn't matter. Basically, what is the generalization of this chain rule in the case of functional modules that have multiple inputs, multiple outputs that you can view as functions? Right.

[40:06] And, basically, it's the same rule if you, kind of, blindly apply them — it's the same rule as you applied for, as you apply for regular derivatives. (Except here you have to use partial derivatives.) You know, what you see in the end is that if you want to compute the derivative of the difference between the output you want and the output you get, which is the value of your objective function, with respect to any variable inside of the network, then you have to kind of back, you know, propagate derivatives backwards and kind of multiply things on the way.

[40:37] All right. We'll be much more formal about this next week. For now, you just know why it's called backpropagation: because it applies to multiple layers. OK, so the the picture I showed earlier of this neural net is nice, but what if the input is actually an image? Right. So, an image, even sort of a relatively low resolution image, is typically like, you know, a few hundred pixels on the side.

[41:12] OK. So let's say 256 x 256, to take a random example. OK, a car image: 256 x 256. So it's got 65,536 pixels, times three, because you have R, G, and B components to it for, you know, you have three value for each pixels. And so that's, you know, roughly two hundred thousand values. OK, so your vector here is a vector with two hundred thousand components. If you have a matrix that is going to multiply this vector, this matrix is going to have to have two hundred thousand rows — Columns, I'm sorry.

[41:50] And depending on how many units you have here in the first layer, there's going to be a 200,000 x, you know, maybe a large number. That's a huge matrix. Right. Even if it's 200,000 x 100,000. So you have a compression in the first layer you know, that's already a lot of—very, very large matrix: billions. So it's not really practical to think of this as a full matrix. What you're going to have to do if you want to deal with things like images is make some hypothesis about the structure of this matrix so that it's not a completely full matrix that, you know, connects everything to everything.

[42:33] That would be impractical. At least for a lot of practical applications. So this is where inspiration from the brain comes back. There was some work, classic work, in neuroscience in the 1960s by the gentlemen at the top here: Hubel and Wiesel. They actually won a Nobel Prize for this in the in the 70s but their workforce from the late 50s—early 60s. And what they did was that they poked electrode in the visual cortex of various animals: you know, cats, monkeys, mice, you know, whatever.

[43:05] (I think they like cats a lot.) And they tried to figure out what the neurons in the visual cortex were doing. And what they discovered was that— so, first of all, well, this is a human brain. But, I mean, this chart is from much later. But all mammalian visual systems is organized in similar way. You have signals coming in to your eyes, striking your retina. You have a few layers of neurons in your retina in front of your photoreceptors that, kind of, pre-process the signal, if you want. They kind of compress it, because you can't have— you know the human eye is something like a hundred million pixels.

[43:49] So it's like a hundred million pixel camera, megapixel camera. But the problem is you cannot have a hundred million fibers coming out of your eyes, because otherwise your optical nerve would be this big. And you wouldn't be able to move your eyes. So those neurons in front of your retina do compression. They don't do JPEG compression, but they do compression. So that the signal can be compressed to one million fibers. Right. You have one million fibers coming out of each of your eyes. And that makes your, you know, optical nerve about this big, which means, you know, you can carry the signal and turn your eyes.

[44:26] This is actually a mistake that evolution made for vertebrates. Invertebrates are not like that. Invertebrates have actually—so, it's a big mistake because the wires collecting the information from your retina, because the neurons that process the signal in front of your retina, the wires have to kind of— it'll be in front of your retina, and so blocking part of the view, if you want. And then they have to punch a hole through your retina to get through your brain.

[44:59] So there's a blind spot in your visual field because that's where your optical nerve punches through your retina. So it's kind of ridiculous if you have a camera like this to have the wires coming out the front and then, you know, dig a hole in your sensor to get the wires back. It's much better if the wires come out the back, right? And vertebrates got that wrong. Invertebrates got it right. So, you know, like squid and octopus actually have wires coming out the back. They're much luckier. But anyway.

[45:33] So, the signal goes from your eyes to a little piece of brain called the lateral geniculate nucleus, which is under your brain actually—and like at the basis of it. It does a little bit of contrast normalization. We'll talk about this again in a few lectures. And, and, then that goes to the back of your brain where the the primary visual cortex area called v1 is. It's called V1 in humans. And there's something called the ventral hierarchy: V1, V2, V4 (IT), which is a bunch of brain areas going from the back to the side. And in the infero-temporal cortex right here, this is where object categories are represented.

[46:17] So, when you go around and you see your grandmother, you have a bunch of neurons firing that represent your grandmother in this area. And it doesn't matter what your grandmother is wearing, you know, what what position she is in, if there is occlusion or whatever—those neurons will fire if you see your grandmother. So the sort of category-level things. And those things have been discovered by experiments with patients that had to have their skull open for a few weeks, and where, you know, people poked electrode and had them watch movies and realize this is known that turns on if Jennifer Aniston is on the movie. And it only turns on for Jennifer Aniston.

[47:03] So with the idea that somehow the visual context, you know, can do pattern recognition and seems to have this sort of hierarchical structure, multi-layer structure, there's also the idea that the visual process is essentially a feed-forward process. So the process by which you recognize an everyday object is very fast. It takes about 100 milliseconds. There's barely enough time for the signal to go from your retina to the infero-temporal cortex. It takes about, it's a few millisecond delay per neuron that you have to go through.

[47:36] 100 milliseconds you barely have time to, for just you know, a few spikes to go through the entire system. So there's no time for like, you know, recurrent connections and like, you know, etc. Doesn't mean that there are no recurrent connections. There's tons of them but somehow fast recognition is done without them. So this is called the the feed-forward ventral pathway. And this gentleman here, Kunihiko Fukushima, had the idea of taking inspiration from Hubel and Wiesel in the 70s, and sort of built a neural net model on the computer that had this idea that, first there were layers, But also the idea that Hubel and Wiesel discovered, that individual neurons only react to a small part of the visual field.

[48:22] So they poked electrodes in neurons in V1 and they realized that this neuron in V1 only reacts to motifs that appear in a very small area in the visual field. And then the neuron next to it will react to another area that's next to the first one, right. So the neurons seem to be organized in what's called a retinotopic way, which means that neighboring neurons react to neighboring regions in the visual field. What they also realized is that the group of neurons that all react to the same area in the visual field, and they seem to turn on for edges at a particular orientation. So one neuron will turn on for, if it's receptive field has an edge, a vertical edge, and then the one next to it if the edge is a little slanted, and then the one next to it if the edge is a little rotated, etc.

[49:09] And so they had this picture of V1 basically as oriented, orientation selectivity, so neurons that look at a local field and then react to orientations. And those groups of neurons that react to multiple orientations are replicated over the entire visual field. So this guy Fukushima said, well, why don't I build a neural net that that does this? I'm not going to, you know, necessarily insist that my system extracts oriented features, but I'm going to use some sort of unsupervised learning algorithm to to train it. So he was not training his system end-to-end. He was training it layer by layer in some sort of unsupervised fashion, which I'm not going to go into the details of.

[49:48] And then he used another concept from, so he used the concept that those neurons were replicated across the visual field, and then he used another concept from Hubel and Wiesel called complex cells. So complex cells are units that pool the activities of a bunch of simple cells, which are those oriented orientation-selective units. And they pull them in such a way that if an orientation, if an oriented edge is moved a little bit it will activate different simple cells, but the complex cell, since it integrates the outputs from all those simple cells, will stay activated until the edge moves beyond its receptive field.

[50:32] So those complex cells build a little bit of shift invariance in the representation. You can shift an edge a little bit, and it will not change the activation the activity of one of those complex cells. So that's what we now call "convolution" and "pooling" in the context of convolutional nets. And that basically is what led me in the mid-80s or late-80s to come up with convolutional nets. So they are basically networks where the connections are local; they are replicated across the visual field; and you intersperse, sort of, feature detection layers that detect those local features with pooling operation. We'll talk about this at length in three weeks.

[51:21] So I'm not going to go to into every detail. But it has, it recycles this idea from Hubel and Wiesel and Fukushima that (...if I can can get my pointer...) that, basically, every neuron in one layer computes a weighted sum of a small area of the input, and the weighted sum uses those weights. But those weights are replicated across, so every neuron in a layer uses the same set of weights. OK, so this is the idea of weight tying or weight sharing.

[51:57] So using backprop we were able to train neural nets like this to recognize handwritten digits. This is back from the late-80s early-90s. And this is me when I was about your age, maybe a little older. I'm about thirty in this video. And this is my phone number when I was working at Bell Labs. Doesn't work anymore. It's a New Jersey number. And I hit a key, and there is this neural net running on the 386 PC with a special accelerator card recognizing those characters, running a neural net very similar to the one I just showed you the animation of.

[52:34] And the thing could, you know, recognize characters of any style, including very strange styles, including even stranger styles. And so this was kind of new at the time because this was back when character recognition, or pattern recognition in general, were still on the model of: we extract features and then we train a classifier on top. And this could basically train the entire, like, learn the entire task from end-to-end.

[53:08] You know, basically, the first few layers of that neural net would would play the role of a feature extractor, but it was trained from data. The reason why we used character recognition is because this was this was the only thing for which we had data. The only task for which there was enough data was either character recognition of speech recognition. Speech recognition experiments were somewhat successful, but not as much. Pretty quickly, we realized we could use those convolutional nets not just to recognize individual characters, but to recognize groups of characters, so multiple characters at a single time. And it's because of this convolutional nature of the network, which I'll come back to in three lectures, that basically allowed those systems to just, you know, be applied to a large image and then they will just turn on whenever they see in their field of view, whenever they see a shape that they can recognize.

[54:02] So, basically, if you have a large image, you train a convolutional net that it has a small input window, and you swipe it over the entire image, and whenever it turns on it means it's detected the object that you trained it to detect. So here the system, you know, is capable of doing simultaneous segmentation and recognition. You know, back in the—before that people in pattern recognition would have an explicit program that would separate individual objects from their background and from each other, and then send each individual object, character for example, to a recognizer. But with this you could, you can do both at the same time.

[54:35] You don't have to worry about it. You don't have to build any special program for it. So in particular this could be applied to natural images for things like facial detection, pedestrian detection, things like this. Right. Same thing, train a convolutional net to distinguish between an image where you have a face and an image where you don't have a face, train this with several thousand examples, and then take that window, swipe it over an image: whenever it turns on there is a face. Of course, the face could be bigger than the window so you sub-sample the image: you make it smaller, and you swipe your network again, and then make it smaller again, swipe your network again. So now you can detect faces regardless of size.

[55:15] OK. In particular you can use this to drive robots. So this is things that were done before deep running became popular, OK. So this is an example where the the network here is a convolutional net. It's applied to the image coming from a camera, from a you know, running robot. And it's trying to classify every window of a small window—like, 40 x 40 pixels or so, even less— as to whether the central pixel in that window is on the ground or is an obstacle, right.

[55:48] So whatever it classifies as being on the ground is green Whatever it classifies as being an obstacle is red or purple, if it's on a foot of the obstacle. And then you can sort of map this to a map, which you see at the top. And then do planning in this map to reach a particular goal, and then use this to navigate. And so these are two former PhD students. Raia Hadsell on the right, Pierre Sermanet on the Left, who are annoying this poor robot.

[56:20] Pretty confident the robot is not going to break their legs, since they actually wrote the code and trained it. Pierre Sermanet is a research scientist at Google Brain in California working on robotics. Raia Hadsell is head of robotics research— Director of Robotics research at DeepMind. They did pretty well. So a similar idea can be used for what's called semantic segmentation. So semantic segmentation is the idea that you can, again, with this kind of sliding window approach, you can train a convolutional net to classify the central pixel using a window as a context.

[56:58] But here it's not just trained to classify obstacles from non-obstacles. It's trained to classify something like 30 categories. This is— this is down Washington Place, I think. This is Washington Square Park. And, it you know, it knows about roads, and people, and plants, and trees, and whatever—but it finds, you know, desert in the middle of Washington Square Park, which is not... There's no beach that I'm aware of... So it's not perfect. At the time it was state of the art, though. That was the best system there was to do this kind of semantic segmentation.

[57:36] I was running around giving talks like trying to evangelize people about deep learning back then. This was around 2010. So this is before the, kind of, deep learning revolution, if you want. And one person, a professor from Israel was sitting in one of my talks. And he's a theoretician, but he was really kind of transfixed by the potential applications of this, and he was just about to take a sabbatical and work for a company called Mobileye, which was a start-up in Israel at the time— working on autonomous driving. And so, a couple of months after he heard my talk, he started working at Mobileye.

[58:15] He told the Mobileye people, you know—"You should try this convolutional net stuff. This works really well." And the engineers there said—Nah. No, we don't believe in that stuff. We have our own method. So he implemented it, and tried it himself, beat the hell out of all the benchmarks they had. And all of a sudden the whole company switched to using convolutional nets. And they were the first company to actually come up with a vision system for cars that, you know, can keep a car in a highway, and can break if there is a pedestrian or cyclist crossing. I'll come back to this in a minute. They were basically using this technique.

[58:54] Semantic segmentation, very similar to the one I showed for the robot before. This was a guy by the name of Shai Shalev-Schwartz. You have to be aware of the fact also that back in the 80s, people were really interested in using, in sort of implementing special types of hardware that could run neural nets really fast. And these are kind of a few examples of neural net chips that were actually implemented—I had to do with some of them— but they were implemented by people working in the same group as I was, as I was at Bell Labs in New Jersey.

[59:28] So this was kind of a hot topic in the 1980s, and then of course with the interest in neural nets dying in the mid-90s people weren't working on this anymore, until a few years ago. Now the hottest topic in in chip design in the chip industry is neural net accelerators. You go to any conference on computer architecture you know, chip, like ISSCC, which is the big kind of solid-state circuit conference—half the talks are about neural net accelerators.

[1:00:03] And I worked on a few of those things. OK, so then something happened, as I told you, around 2010, -13, -15 in speech recognition, image recognition, natural language processing, and it's continuing. We're in the middle of it now for other topics. And what happened, and I'm really sad to say it didn't happen in my lab, but but with our friends, we started, with Yoshua Bengio and Geoff Hinton back in the early 2000s—we knew, you know that deep learning was working really well and we knew that the whole community was making a mistake by dismissing neural nets and deep learning. And so— we didn't use the term deep learning yet. We invented it a few years later—so, around 2003 or so, 2004, we started kind of a conspiracy, if you want. We got together and we said we're just going to try to, kind of, beat some records, and some data sets, invent some new algorithms that will allow us to train very large neural nets.

[1:01:03] So that will, and will collect very large data sets, so that we will show the world that those things really work, because nobody really believed it. That really kind of succeeded beyond our wildest dreams. In particular, in 2012 Geoff Hinton had one student Alex Krizhevsky, who spent a lot of time implementing convolutional nets on GPUs, which were kind of new at the time—they were not entirely new but they were starting to become really high-performance. So he was very good at sort of hacking that and and then they were able to train much larger neural nets, convolutional nets, than anybody was able to do before.

[1:01:44] And so they used it to to train on the ImageNet dataset. The ImageNet dataset is a bunch of natural photos. And the system is supposed to recognize the main objects in the photo among 1,000 different categories. And the training set had 1.3 million samples. Which is kinda large. So what they did was build this really large, and very deep convolutional net, pretty much on the same model as what we had before, implemented on GPUs, and let it run for a couple weeks. And with that they beat the performance of best competing systems by a large margin. So this is the error rate on ImageNet going back to 2010. So 2010 it was about 28% error, top 5.

[1:02:35] So, basically you get an error if the correct category is not in the top 5 among 1,000. OK, so it's kind of a mild measure of error. 2011 it was 25.8%, the system that was able to do this was actually very, very large. It was sort of somewhat convolutional-net-like, but it wasn't trained. I mean only the last layer was trained. And then Geoff and his team got it down to 16.4%, and then that was a watershed moment for the computer vision community. A lot of people said, Okay, you know now we know that this thing works.

[1:03:18] And the whole community went from basically refusing every paper that had neural nets in them in 2011 and 2012 to refusing every paper that does not have a convolutional net in it in 2016. So now it's the new religion, right. You can't get a paper in a computer vision conference unless you use ConvNets somehow. And the error rate went down really quickly, you know people found all kinds of really cute architectural tricks that, sort of, made those things work better. And what you'd see in there is that there was an inflation of the number of layers.

[1:03:56] So my convolutional nets from the 90s had 7 layers or so, and from the early 2000s. And then AlexNet had, I don't know, 12. Then VGG the year afterward, after that had 19. GoogLeNet had I don't know how many, because it's hard to figure out how you count. And then the workhorse now of object recognition, the standard backbone, as people called them, has 50 layers. It's called ResNet-50. But some, you know, some networks have 100 layers or so.

[1:04:29] So Alfredo a few years ago put together this chart that shows where each of those blob is a particular network architecture. And the x-axis is the number of billions of operations you need to do to compute the output. Okay, those things are really big billions of connections. The y-axis is the top one accuracy on ImageNet. So it's not the same measure of performance as the one I showed you before. So the best systems are around 84, today.

[1:05:01] And the size of the of the blob is the memory occupancy, so the number of millions of floats that you need to store to store the weight, the weight values. Now people are very smart about compressing those things like you know quantizing them, and there's entire teams at Google, Facebook, and various other places that only work on optimizing those networks and compressing the things so they can run fast. Because, to give you just a rough idea, the number of times Facebook, for example, runs a convolutional net on its servers per day is in the tens of billions.

[1:05:44] Okay. So there's a huge incentive to optimizing the amount of computation necessary for this. So one... one reason why convolutional nets are being so successful is that they exploit a property of natural data, which is compositionality. So compositionality is the property by which a scene is composed of objects; objects are composed of parts; parts are composed of sub-parts; sub-parts are really combinations of motifs; and motifs are combinations of contours or edges, right, or textures.

[1:06:33] And those are just combinations of pixels. Okay, so there's this so-called compositional hierarchy that, you know, particular combinations of objects at one layer in the hierarchy form objects at the next layer. And so if you, kind of, mimic this compositional hierarchy in the architecture of the network, and you let it learn the appropriate combinations of features at one layer that, you know, form the the features of the next layer, that's really what deep learning is.

[1:07:06] Okay. Learning to represent the world and exploit the structure of the world—and the world, being the fact that there is organization in the world because the world is compositional. A statistician by the name of Stuart Geman, who is at Brown University, said— so he was kind of playing on the famous Einstein quote, Einstein said: The most incomprehensible thing about the world is that the world is comprehensible. Like, among all the complicated things that the world, you know, the world could be extremely complicated, so complicated that we have no way of understanding it.

[1:07:42] And it looks like a conspiracy that we are able to understand at least part of the world. And so Stuart Geman's version of this is that the world is compositional... or there is a God. (Because you need supernatural things to be able to understand it if the world is not compositional.) So this has led to incredible progress in things like computer vision, as you know, from you know, being able to unreliably identify, you know, detect people, to being able to generate masks for every object, accurate masks, and then even to figure out the pose, and then do this in real time on a mobile platform, you know.

[1:08:25] I mean the progress has been sort of nothing short of incredible, and most of those things are based on two basic families of architectures. This sort of so-called one-pass object detection/recognition architectures called RetinaNet, feature pyramid network. There's various names for it. Or U-Net. Then another type called Mark-RCNN, both of them actually originated from Facebook. Or, the people who originated them are now at Facebook—they sometimes came up with it before they came to Facebook.

[1:08:59] But, you know, those things work really well, you know, they can do things like that: detect objects that are partially occluded, and, you know, draw a mask of every object. So basically, this is a neural net, a convolutional net where the input is an image. But the output is also an image. In fact, the output is a whole bunch of images, one per category. And for each category outputs the mask of the object from that category. Those things can also do what's called "instant segmentation." So if you have a whole bunch of sheeps, it can tell you, you know, not just that this region is sheep, but actually pick out the individual sheeps and will tell them apart, and it will count the sheeps right, and fall asleep.

[1:09:40] That's what you're supposed to do right, to fall asleep you count sheeps, right? And the cool thing about deep learning is that a lot of the community has embraced the whole concept that research has to be done in the open. So a lot of the stuff that we're gonna be talking about, as you probably know, in the class is it's not just published, but it's you know, published with code. It's not just code, it's actually pre-trained models that you can just download and run.

[1:10:13] All open source. All free to use. So that's really new. I mean people didn't use to do research this way, particularly in industry. But even in academia people weren't used to kind of distributing their code. But deep learning has sort of, somehow the race has kind of driven people to kind of be more open about research. So there's a lot of applications of all this, as I said, you know self-driving cars. This is actually a video from Mobileye, and Mobileye was pretty early in this in using convolutional nets for autonomous driving.

[1:10:45] To the point that in 2015 they had managed to shoehorn a convolutional net on the chip that they had designed for some other purpose. And they sold the licensed the technology to Tesla. So the first self-driving Tesla's, I mean self-driving, not really self-driving, they have driving assistance, right. They can keep in lane on the highway and change lane—had this Mobileye system. And, and that's, that's pretty cool. So that's a convolutional net. It's a little chip that is, you know, just behind the, it looks out the window and it's behind the the rear-view mirror.

[1:11:18] Since then this—you know, four/five years ago—since then this kind of technology has been very widely deployed by a lot of different companies. Mobileye still now was bought by Intel, and they have like 70 or 80 percent of the market for those vision systems. But, but there is a lot of companies that—and car manufacturers— that use those things. So in fact in some European countries, every single car that comes out, even low-end cars, has convolutional-net-based vision systems. And they call this: emergency, emergency, sort of, advanced emergency braking system or automated emergency braking system.

[1:11:56] AEBS— is deployed in every car in France, for example. It reduces collisions by 40%. So not every car on the roads have them yet, because you know people keep their cars for a long time. But what that means is that it saves lives. So a very positive application of deep learning. Another big category of applications, of course, is medical imaging. So this is a, it's probably the hottest topic in radiology these days—is how to use AI (which means convolutional nets) for radiology. This [slide image] is lifted from a paper by some of our colleagues here at NYU, where they analyzed MRI images. So there's one big advantage to convolutional nets: it's that they don't need to look at the screen to look at an MRI. In particular to be able to look at an MRI, they don't have to slice it into 2D images.

[1:12:56] They can look at the entire 3D volume. This is one property that this thing uses. It's a 3D convolutional net that looks at the entire volume of an MRI image and then produces, you know, it uses the very similar technique for, as I was showing before, for semantic segmentation. And it produces, it basically turns on on the output image wherever there is some, you know, here a femur bone, but you know, it could be— so this is the kind of result it produces. It works better in 3D than in 2D slices. Or, it can turn on when it detects malignant tumor in mammograms. (This is to 2D, it's not 3D.)

[1:13:37] And there's, you know, various other projects in medical imaging that are going around. Okay. Lots of applications in science and physics, bioinformatics, you know, whatever, which we'll come back to so... Okay. So there's a bunch mysteries in deep learning. They're not complete mysteries, because people have some understanding of all this, but they are mysteries in the sense that we don't have, like, a nice theory for everything.

[1:14:11] Why do they work so well? So one big question that theoreticians were asking many years ago, when I was trying to convince the world that deep longing was a good idea, was that they would tell me: Well, you can approximate any function with just two layers, why do you need more? And I'll come back to this in a minute. What's so special about convolutional nets? I talked about the compositionality of natural images, or natural data, in general. This is true for speech also and values of the signals, natural signals. But it seems a little contrived.

[1:14:45] How is it that we can train the system, despite the fact that the objective function we're minimizing is very non-convex. We may have lots of local minima. This was a big criticism that people were throwing at neural nets, people who'd never played with neural nets were throwing out neural nets back in the old days. Say, like you know, you have no guarantee that your algorithm will converge—you know, it's too scary. I'm not gonna use it. And, the last one is: why is it that the way we train neural nets breaks everything that every textbook in statistics tell you?

[1:15:19] Every textbook in statistics tells you, if you have n data points, you shouldn't have more than n parameters, because you're going to overfit like crazy. You know, you might regularize. If you're a Bayesian, you might through a prior. But... (which is equivalent) But what guarantee do you have? And with neural nets, neural nets are wildly over parametrized. We train neural nets with hundreds of millions of parameters, routinely. They're used in production. And the number of training samples is nowhere near that. How does that work?

[1:15:53] But it works! OK, so things we can do with deep learning today: You know, we can have safer cars; we can have better medical analysis, medical image analysis systems; we can have pretty good language translation, far from perfect, but useful; stupid chatbots; you know, very good information search retrieval and filtering. Google and Facebook nowadays are completely built around deep learning. You take deep learning out of them and they crumble.

[1:16:27] And, you know, lots of applications in energy management and production, and all kinds of stuff; manufacturing, environmental protection. But we don't have really intelligent machines. We don't have machines with common sense. We don't have intelligent personal assistants. We don't have, you know, smart chatbots. We don't have household robots. You know, I mean, there's a lot of things we don't know how to do, right. Which is why we still do research. OK, so, deep learning is really about learning representations. But really we should know in advance what representations are. So I talked about the traditional model of pattern recognition.

[1:17:04] But... Representation is really about you know, you have your raw data, and you want to turn it into a form that is useful, somehow. Ideally, you'd like to turn it into a form that's useful regardless of what you want to do with it. Sort of "useful" in a general way. OK, and it's not entirely clear what that means. But, at least, you want to turn it into a representation that's useful for the task that you are envisioning. And there's been a lot of ideas over the decades on, sort of, general ways to pre-process natural data in such a way that you produce good representations of it.

[1:17:54] I'm not going to go through the details of this laundry list. But the things like tallying the space, doing random projection. So random projection is actually, kind of, you know, like a monster that rears its head periodically, like every five years. And you have to whack it on the head every time he pops up. That was the idea behind the Perceptron. So the first layer of a perceptron is a layer of random projections. What does that mean? A random projection is a random matrix, which you know, has a smaller output dimension than input dimension, with some sort of non-linearity at the end, right. So think about a single layer neural net with nonlinearities, but the weights are random.

[1:18:38] So you can think of this as random projections. And a lot of people are rediscovering that wheel periodically, claiming that it's great because you don't have to do multi-layer training. And so it started with the Perceptron, and then you know it came back in the 60s, and then it came back again in the 1980s, and then it came back again. And now it came back. There's a whole community, mostly in Asia. They call two layer neural nets, where the first layer is random, they call this "extreme learning machines," OK.

[1:19:12] It's like, it's ridiculous, but it exists. They're not "extreme," I mean they're extremely stupid, but—you know. Right, so I was mentioning the compositionality of the world. It's, you know, from pixels to edges to texton, motifs, parts, objects. In text you have characters, word, word groups, clauses, sentences, stories. In speech it's the same, you have individual samples. You have, you know, spectral band, sound, phone, phonemes, words, etc.

[1:19:49] You always have this kind of hierarchy. OK, so here are many attempts at dismissing the whole idea of deep learning. OK, first, first thing. And this is things that I've heard for decades, OK— from mostly theoreticians, but a lot of people, and you have to know about them because they're going to come back in five years when people say, "Oh, deep learning sucks." Why not use support-vector machines? OK, so, here is support-vector machines here on the top left. Support-vector machine is a, and I'm sure many of you have heard about kernel machines and support-vector machines.

[1:20:22] Who knows what this is? I mean, even if it's a rough idea what this is. OK, a few hands. Who has no idea what a support-vector machine is? Don't be shy. Yeah. Yeah, I mean it's okay if you don't. OK, like most people haven't raised their hands for either. [Alfredo: Hands up, please, who knows support-vector machines.] OK, come on all the way up. Cool, all right. Who has no idea what it is? Don't be shy, it's okay. [Alfredo: inaudible] All right, good.

[1:20:55] Right, so here's the support-vector machine. Support-vector machine is a two layer neural net. It's not really a neural net, people don't like when it's formulated this way, but really you can think of it this way. It's a two layer neural net, where the first layer, which is symbolized by this function K here, each unit in the first layer compares the input vector X to one of the training samples X^i's. OK, so you take your training samples, let's say you have a thousand of them— so you have a thousand X^i's, from i = 1 to 1,000, and you have some function K that is going to compare X and X^i.

[1:21:26] Good example of a function to compare the two is you take the dot product between X and X^i, and you pass the result through, like, exponential minus square or something. So you get a Gaussian response, as a function of the distance between X and X^i, OK. So it's a way of comparing to two vectors, doesn't matter what it is. And, then you take those scores coming out of this K function that compares the input to every sample and you compute a weighted sum of them. And what you're going to learn are the weights, the alphas.

[1:21:59] Okay, so it's a two-layer neural net in which the second layer is trainable and the first layer is fixed. But in a way you can think of the first layer as being trained in an unsupervised manner, because it uses the data from the training set, but it only uses the X's, doesn't use the Y's. It uses the data in the stupidest way you can imagine, which is you store every X and use every single X as the weight of a neuron, if you want. Okay. That's what support vector machine is. You can write a thousand page book about the cute mathematics behind that. But the bottom line is it's a two-layer neural net where the first layer is trainied a very stupid way unsupervised, and the second layer is just a linear classifier.

[1:22:44] So, it's basically glorified template matching, because it basically compares the input vector to all the all the training samples. And so, it doesn't work if you want to do like, you know, computer vision with raw images. If X is an image and the X^i's are a million images from ImageNet— first of all, for every image you're gonna have to compare it with a million images, or maybe a little less if you're smart, and how you train it. That's going to be very expensive, and the kind of comparison you're making is basically what solves the problem. The weighted sum you're gonna get at the end is really the cherry on the cake.

[1:23:24] I use that analogy too often, actually. So... You can approximate, you can have theorems that show that you can approximate any function you want, as close as you want, by tuning the K function and the alphas. And so, if you were to talk to a theoretician, they'll tell you: Why do you need deep learning? I can approximate any function I want with a kernel machine. The number of terms in that sum can be very large, and nobody tells you what kernel function you can use. And so, that doesn't solve the problem.

[1:24:01] You can use a two-layer neural net, OK. So this is the top right here. The first layer is a nonlinear function F applied to the product of a matrix W^0 by input vector; and then the second layer multiplied by the second matrix; and then passes it through another non-linearity. OK, so this is a composition of two linear and non-linear operations. Again, you can show that under some conditions you can approximate any function you want with something like this. Given that you have a large enough vector in the middle.

[1:24:31] OK, so the dimension of what comes out of the first layer, if it's high enough —potentially infinite—you can approximate any function you want as close as you want, by making this layer go to infinity. So again, you talk to theoreticians and they tell you: Why do you need layers? I can approximate anything I want with two layers. But there is an argument, which is it could be very, very expensive to do it in two layers. And...

[1:25:03] For some of you this may sound familiar. For most of you probably not. Let's say I want to design a logic circuit. OK, so, when you design logic circuits, right, you have AND-gates and OR-gates and... or NAND-gates, right. You can do everything with just NAND's, right, negative ANDs. And if you.. You can show that any Boolean function can be written as a bunch of ORs on a bunch of, a bunch... you know, a bunch of ANDs and then an OR on top of this. That's called disjointed normal form (DNF).

[1:25:36] So any function can be written in two layers. The problem is that for most functions, the number of terms you need in the middle is exponential in the size of the input. So, for example, if I give you N bits, and ask you to construct a circuit that tells me if the number of bits that are on in the input string is even or odd. OK, it's a simple Boolean function: 1 or 0 on the output. The number of gates that you need is essentially exponential, in the middle. If you do it in two layers.

[1:26:09] If you allow yourself to do it in log(N) layers, where N is number of input bits, then it's linear. OK. So you go from exponential complexity to linear complexity if you allow yourself to use multiple layers. It's as if, you know, when you write a program— I'll tell you write the program in such a way that there is only two sequential steps that are necessary to run your program. So basically your program has two sequential instructions. You can have, you can run as many instructions as you want in your program but they have to run in parallel, most of them. And you're only allowed two sequential steps.

[1:26:52] OK. And, the kind of instructions you have access to are things like, you know, linear combinations, nonlinearities— like simple things, right. Not like entire sub-programs. So for most, most problems, the number of intermediate values you're going to have to compute in the first step is going to be exponential in the size of the input. There's only a tiny number of problems for which you're going to be able to get away with a non-exponential number of minterms.

[1:27:25] But if you allow your program to run multiple steps sequentially then all of a sudden, you know, it can be much simpler. It will run slower, but it will take a lot less memory. It will take a lot less stuff— resources. So people who design computers circuits know this, right. You can design, for example, a circuit that adds two binary numbers. And there is a very simple way to do this, which is that you first you take the first two bits, you add them, and then you propagate the carry at the second bit, the second pair of bits, you know, taking the carry into account that gives you the second bit of result, and then carry, you know, propagate the carry, and then you do this sequentially, right.

[1:28:02] So problem with this is that it takes the time that's proportional to the size of the numbers that you're trying to add. So circuit designers have a way of, basically, pre-computing the carry, it's called carry lookahead, so that the number of steps necessary to do an addition is actually not N, it's much less than that. OK. But that, that's at the expense of a huge increase in the complexity of the circuit. The the number, like the area that it takes on the chip. So this exchange between time and space, or, between depth and and...

[1:28:42] and, kind of, time is is known. So what do we call deep models? So, you know, a two-layer neural net, one that has one hidden layer, I don't call that "deep," even though technically it uses backprop. But, eh, you know, it doesn't really learn complex representations. So there's this idea of hierarchy in deep learning. SVMs definitely aren't deep. Unless you learn complicated kernels, but then they're not SVM's anymore. So what are good features? What are good representations?

[1:29:20] So, here's an example I like. There is something called the manifold hypothesis, and it's the fact that natural data— So, if I take a picture of this room with, you know, a camera with a 1,000 x 1,000 pixel resolution. That's 1 million pixels at 3 million values. It leaves, you can think of it as a vector with 3 million components. Among all the possible vectors with 3 million components, how many of them correspond to what we would call natural images?

[1:29:54] We can tell when we see a picture whether it's a natural image or not. We have a model in our visual system that tells us this looks like a real, like a real image. And we can tell when it's not. So the number of combinations of pixels that actually are things that we think of as natural images is a tiny, tiny, tiny, tiny, tiny subset of the set of all possible images. There's way more ways of combining random pixels in nonsensical images than there are ways of combining pixels into things that look like natural images.

[1:30:27] So the manifold hypothesis is that the set of things that, you know, look natural to us live in a low-dimensional surface inside the high-dimensional ambient space. And a good example to convince yourself of this: Imagine I take lots of pictures of a person making faces, right. So the person is in front of a white background. Her hair not moving. And she, kind of, moves her head around and, you know, makes faces, etc. The set of all images of that person—so I take a long video of that person—the set of all images of that person lives in a low dimensional surface.

[1:31:07] So a question I have for you is, What's the dimension of that surface? Whatever magnitude, okay. Any, yes? [Inaudible student comment.] Yeah, you've probably heard my spiel before, but... [Speaker: What did the person say?] Huh? [Speaker: What did they say?] OK, so for whoever hasn't heard this, you have a shot, another shot at an answer. OK, any guess?

[1:31:41] No? Don't be shy. I want like multiple proposals. Anyone. You can look down your laptop, but, you know, I can point at you or something. OK, any idea? Yes.

[1:32:11] No idea? It's OK. You, any idea? Maybe you heard what he said. [Inaudible student comment.] Linear, what does that mean? [Inaudible student comment.] It's a 1D space. OK, a one-dimensional subspace. OK, any other proposal? Any idea? OK, the images I'm taking are a million pixels. OK, so the ambient space is 3 million dimensions.

[1:32:52] [Inaudible student comment] They don't change, no. And the person can move the head, you know, turn around, things like this. But not really move the whole body. I mean you only see the face, it's mostly centered. [Student: A thousand.] A thousand, OK. Why? [Inaudible student comment.]

[1:33:23] OK yeah, that's a good guess. At least the motivation. [Inaudible student comment.] Say again. [Student: The surface area of the person.] The surface area of the person. Right. So it's bounded by the number of pixels occupied by the person. That's for sure. That's a, that's an upper bound. Yes. Those pixels, of course, are not gonna take all possible values. So that's a wide upper ground. Any other idea? OK. So, basically the dimension of that, as you said, Is bounded by the number of muscles in the face of the person.

[1:34:03] Right. The number of degrees of freedom that you observe in that person is the number of muscles in their face. The number of independently movable muscles, right. So there's 3 degrees of freedom due to the fact that you can tilt your head this way, that way, or that way. That's 3, right there. Then there is translation, this way, that way. Maybe this way and that way, maybe up or down. That's 6. And then the number of muscles in your face, right. So you can smile. You can, you know, pout. You can do all kinds of stuff, right. And you can do this, you know, independently. You close one eye.

[1:34:46] You can smile in one direction, you know, I mean... So, whatever independent muscles, you have—not counting the tongue, because there's tons of muscles in the tongue. And that's about 50. Maybe a little more. So, regardless, it's less than 100. OK, so the surface, locally, if you want to parameterize the surface occupied by all those pictures—move from one picture to another— it's a surface with less than 100 parameters that determine the position of a point on that surface. Of course it's a highly nonlinear surface.

[1:35:21] It's not like this beautiful Calabi-Yau manifold here, but but it's a it is a surface nonetheless. Of course the answer was in the slide so, you know. So what you'd like is an ideal feature extractor to be able to disentangle the explanatory factors of variation of what you're observing. Right. So the different aspects of my face, you know, it's not just I move my muscles and I move my head around—each of those is an independent factor of variation. Again I can also remove my glasses.

[1:35:53] You know, the lighting could change. That's another set of, you know, variable— variables. And what you'd like is a representation that basically individually represents each of those factors of variations. So if there is a criterion to satisfy in learning good representations it's that: it's finding independent explanatory factors of variation of the data that you're looking at. And the bottom line is that nobody has any idea how to do this. OK. But that would be the ultimate goal of representation learning.

[1:36:32] And we basically are at the end. OK. I'll take two more questions, if there is any. Yes. [Inaudible student question.] OK, so the question is: Is there some sort of pre-processing like PCA that will find those vectors? Yeah, so PCA will find those if the manifold is linear. So if you assume that the surface occupied by all those examples or faces is a plane, then PCA will find the dimension of that plane—principal component analysis, right.

[1:37:18] But, no, it's not linear unfortunately, right. Let me... Yeah, let me give you an example. If you take me and my oldest son that looks like me, and you place us making the same face in the same position, the distance between our images will be relatively small even though we're not the same person. Now if you take my face and my face shifted by 20 pixels, there's more distance between me and myself shifted than there is between me and my son, OK.

[1:37:53] So... What that means is that, you know, the manifold of my face, you know, is some complicated manifold in that space. My son is a slight different manifold which does not intersect mine. Yet these two, those two manifolds are very close to each other, and they're closer to each other than any two samples from my manifold, and two samples from his manifold. So PCA is not going to tell you anything, basically. OK, here is another reason why that surface is not, is not a plane.

[1:38:26] You're looking at me right now. Now imagine the manifold, which is a linear manifold, one dimensional manifold, of me turning my head all the way 360. OK. That manifold is topologically identical to a circle. It's not flat. Can't be, it can't be aligned. So PCA is not going to find it. OK, I gotta blast off. Thanks! See you next week.

在 Vidleaf 工作台中打开

搜索转录文本、选择行、复制带时间戳的引文、翻译。

署名

“第 1 周——讲座:深度学习的历史、动机与演进”,作者 Alfredo Canziani(冷在)(https://www.youtube.com/@alfcnz),依据 CC BY 4.0(https://creativecommons.org/licenses/by/4.0/)许可。源视频:https://www.youtube.com/watch?v=0bMe_vCZo30。本页是该视频的文本转录,添加了段落分隔和时间戳;创作者与 Vidleaf 无关联,也不为其背书。Vidleaf 添加了 AI 标点和 AI 生成的摘要;原始措辞仍可在本页查看。

您是创作者或权利持有人吗?申请更正或删除:copyright@vidleaf.app(参见 关于这些页面)。

最后更新于