AI, graphs and neural networks
引入本课内容
| English | 释义 | 拼音 |
|---|---|---|
| image-recognition | 图像识别 | tú xiàng shí bié |
| error rate | 错误率 | cuò wù lǜ |
| machine learning/məˈʃiːn ˈlɜːnɪŋ/ | 机器学习 | jī qì xué xí |
| deep learning/diːp ˈlɜːnɪŋ/ | 深度学习 | shēn dù xué xí |
| graph/ɡræf/ | 图 | tú |
| artificial neural network/ˌɑːtɪˈfɪʃl ˈnjuːrəl ˈnetwɜːk/ | 人工神经网络 | rén gōng shén jīng wǎng luò |
| Artificial intelligence/ˌɑːtɪˈfɪʃl ɪnˈtelɪdʒəns/ | 人工智能 | rén gōng zhì néng |
| algorithms/ˈælɡərɪθəmz/ | 算法 | suàn fǎ |
| neural networks/ˈnjuːrəl ˈnetwɜːks/ | 神经网络 | shén jīng wǎng luò |
| raw data | 原始数据 | yuán shǐ shù jù |
| pixels/ˈpɪkslz/ | 像素 | xiàng sù |
| features/ˈfiːtʃəz/ | 特征 | tè zhēng |
| nodes/nəʊdz/ | 节点 | jié diǎn |
| edges/ˈedʒɪz/ | 边 | biān |
| Pathfinding | 寻路 | xún lù |
| graph search | 图搜索 | tú sōu suǒ |
| Dijkstra's algorithm/ˈdeɪkstrəz ˈælɡərɪθəm/ | 迪杰斯特拉算法 | dí jié sī tè lā suàn fǎ |
| A\* | A*算法 | A* suàn fǎ |
| tree/triː/ | 树 | shù |
| minimax/ˈmɪnɪmæks/ | 极小化极大 | jí xiǎo huà jí dà |
| Knowledge representation | 知识表示 | zhī shí biǎo shì |
| semantic network/səˈmæntɪk ˈnetwɜːk/ | 语义网络 | yǔ yì wǎng luò |
| Breadth-first/bredθ fɜːst/ | 广度优先 | guǎng dù yōu xiān |
| depth-first/depθ fɜːst/ | 深度优先 | shēn dù yōu xiān |
| weight/weɪt/ | 权重 | quán zhòng |
| artificial neuron/ˌɑːtɪˈfɪʃl ˈnjuːrɒn/ | 人工神经元 | rén gōng shén jīng yuán |
| bias/ˈbaɪəs/ | 偏置 | piān zhì |
| non-linear | 非线性 | fēi xiàn xìng |
| activation function/ˌæktɪˈveɪʃn ˈfʌŋkʃn/ | 激活函数 | jī huó hán shù |
| input layer | 输入层 | shū rù céng |
| hidden layers/ˈhɪdn ˈleɪəz/ | 隐藏层 | yǐn cáng céng |
| output layer | 输出层 | shū chū céng |
| class/klæs/ | 类别 | lèi bié |
| training/ˈtreɪnɪŋ/ | 训练 | xùn liàn |
| architecture/ˈɑːkɪtektʃə/ | 网络结构 | wǎng luò jié gòu |
没人告诉它该看什么,它却学会了看
- 2012 年,一个团队带着一个程序参加图像识别比赛,而这个程序从未被告知任何一条关于猫长什么样的规则。它看过一百万张有标签的照片,规则是它自己琢磨出来的。
- 它的错误率是所有人工编程的参赛作品的一半。三年之内,整个领域都放弃了编写规则。
- 这个逆转就是本单元的主题:问题不再是“我们怎样告诉计算机猫是什么”,而是“计算机怎样从例子里把这件事琢磨出来”。
- 这一课讲机器学习和深度学习是什么意思、图怎样把 AI 问题变成搜索,以及人工神经网络究竟在计算什么。
AI、机器学习和深度学习
- 人工智能是一个宽泛的目标:让系统执行通常需要人类智能的任务,比如视觉、语音、翻译和驾驶。
- 机器学习是其中占主导的方法:算法从数据中学习规律,而不是被一步步编程。
- 深度学习是使用多层神经网络的机器学习。自 2010 年代起,它一直引领该领域,因为它直接从原始数据——像素、音频或文本——学习,不需要人工设计的特征。
- 它们是嵌套的:深度学习属于机器学习,机器学习属于 AI。

三个圆,不是三个对手
Machine learning means an algorithm that:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
ML learns from data; deep learning is ML using multi-layer neural networks.
How do AI, machine learning and deep learning relate?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
AI is the goal, machine learning is the dominant approach to it, and deep learning is machine learning with many-layered networks.
图,以及为什么大量 AI 问题都是搜索问题
- 图是由边连接的一组节点。节点是状态、地点或概念;边是移动、道路或关系。
- 寻路:道路网就是一张图,找路线就是图搜索,可以使用 Dijkstra 算法或 A*。
- 下棋:每个棋局是一个节点,每步合法的走法是一条边,于是棋局构成一棵树,由极小化极大算法搜索,并假定每位棋手都选择最优走法。
- 知识表示:语义网络把概念当作节点、关系当作边。广度优先和深度优先搜索是探索这些图的标准工具。
In AI, a graph consists of:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Graphs model states/places as nodes and moves/relationships as edges — used for pathfinding, game trees and knowledge.
例题:把问题建模成图
- 一家配送公司想找两个城镇之间的最短路线。描述这怎样表示成一张图。
- 每个城镇是一个节点;每条道路是一条边,连接两个节点;边带一个权重,即距离或行驶时间。
- 问题于是变成"找出两个节点之间总权重最小的路径",这由 Dijkstra 算法解决。
- 要说出节点是什么、边是什么、权重代表什么。只说"这是一张图"的答案不得分。

A road network is modelled as a graph to find the shortest route. Which statements are correct? Select 所有 that apply.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Places are nodes and connections are edges. Saying what the weights represent is the third mark.
人工神经元
- 人工神经元接收若干输入。它把每个输入乘以一个权重,把这些乘积连同一个偏置加起来,再把总和送过一个非线性的激活函数,得出它的输出。
- 权重就是网络所学到的东西。激活函数让网络能表示直线以外的关系:没有它,无论有多少层,都会合并成一个线性公式。

相乘、相加,然后弯折
Put the steps inside one artificial neuron in order.
难度 3/5 · 今日首次完成可获 200 金币及少量额外奖励
Multiply, sum, activate, pass on. Without the non-linear activation, any depth of network would collapse into one linear formula.
层,以及“深”是什么意思
- 神经元按层排列。输入层接收数据。一个或多个隐藏层学习内部规律。输出层给出答案,即一个类别或一个数。
- 当一个网络有很多隐藏层时,它被称为深的,而训练这样的网络就是深度学习。
- 隐藏层为什么重要:在图像网络里,靠前的层学到边缘,中间的层学到形状,靠后的层学到物体。没有人设计这个层级;它是训练产生的。

输入、隐藏、输出,学习存在于它们之间的权重中
Tap the parts of a neural network
Explore the layers. Data flows left to right: the input layer takes the features, the hidden layers learn patterns, and the output layer gives the answer — with every connection carrying a weight that training adjusts.
Match each part of a neural network to its role.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Features enter the input layer, hidden layers learn patterns, the output layer answers; learning = tuning the weights.
A neural network is called "deep" when it has many hidden layers, and each neuron takes a weighted sum of its inputs (plus a bias) before applying an activation function.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Stacking many hidden layers lets the network learn richer patterns — training such a network is deep learning.
A neural network is called "deep" when it has:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Many hidden layers make a deep neural network; training one is deep learning.
During training, the values adjusted inside a neural network are its ____.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
The architecture and the activation function are chosen by the designer; what the network learns is stored in the weights.
例题:描述神经元怎样计算
- 描述一个人工神经元内部发生了什么。[3]
- 每个输入乘以它自己的权重,这些乘积连同一个偏置加起来。
- 得到的和被送过一个激活函数,该函数是非线性的。
- 结果就是这个神经元的输出,它成为下一层各神经元的输入。权重和偏置就是训练过程中被调整的值。

容易丢掉的分
- 机器学习学的是数据中的规律;它不是“一步步编程”,也不是魔法。要说出它从什么中学习。
- “深”意味着很多隐藏层,不是“很聪明”或“很大”。
- 图由节点和边构成,回答图的问题时必须说出它们在这个问题中各代表什么。
- 训练改变的是权重。激活函数和网络结构由设计者选定。
你掌握了
- AI 是目标,机器学习从数据中学习规律而不是遵循写好的规则,深度学习是使用多层神经网络的机器学习
- 由节点和边构成的图把寻路、下棋和知识表示变成搜索,用 Dijkstra、A*、极小化极大、广度优先和深度优先
- 人工神经元把输入乘以权重、加上偏置,再应用非线性的激活函数
- 各层依次是输入、隐藏、输出;深意味着很多隐藏层,而学习就存在于权重之中
出了什么问题?只有网站团队能看到这些信息。
Try it in the lab 32
All labs →- Teach a Perceptron
- Train a Network on Your Drawings
- Teach a Robot by Reward
- Build a Decision Tree
- Nearest Neighbours
- Roll Down the Loss
- Find the Groups
- Find the Shortest Route
- See Like a Computer
- Guess the Next Word
- Is the Computer Fair?
- Build an Expert System
- Evolve a Catapult
- Catch the Spam
- Think Ahead
- Inside a Neural Network
- Learning or Remembering? Overfitting
- Search the Maze
- What Should I Watch? A Recommender
- Teach a Car to Drive
- Matchbox Learner
- Build a Chatbot
- Fewer Colours
- Mood Meter
- Spot the Fraud
- Hear the Word
- Follow the Ants
- Plan the Delivery Round
- Squash the Data
- Explore or Exploit? Learning by Trying
- Mark the Model
- Ask Many Models