First exams 2027 · HL only 2027 年首次开考 · 仅 HL

A4.3.8 · Machine learning approaches (HL only)

A4.3.8 · 机器学习方法(仅 HL)

Artificial Neural Networks

人工神经网络

Loosely modelled on the brain's own web of neurons, an artificial neural network is layers of simple nodes, each doing nothing more than a weighted sum and a small decision, that together can learn far more complex patterns than any one node could alone.

人工神经网络大致模仿大脑自身的神经元网络,由一层层简单的节点组成,每个节点做的不过是一次加权求和和一个小小的判断,但它们合在一起,能学到比任何单个节点复杂得多的模式。

The command term here is "outline": this statement needs the structure and mechanism stated clearly, not a full mathematical derivation of training.

这里的命令词是"outline(概述)":本条考纲要求清楚说明结构和机制,而不是对训练过程做完整的数学推导。

HL only 仅 HL Typically 3–4 marks · AO2 通常 3–4 分 · AO2 Command term: outline 命令词:outline(概述)

Explainer

讲解

Layers, weights, biases

层、权重、偏置

Df

An ANN (artificial neural network) is built from an input layer, one or more hidden layers, and an output layer. Each node in a hidden or output layer multiplies each incoming value by a weight, sums them, adds a bias, and passes the result through an activation function before sending it on.

人工神经网络(ANN)由一个输入层、一个或多个隐藏层和一个输出层组成。隐藏层或输出层中的每个节点把每个传入的值乘以一个权重,把它们求和,加上一个偏置,再把结果送入一个激活函数,然后才继续往后传。

Activation functionWhat it doesTypical use
SigmoidSquashes any input to a value between 0 and 1Output layer of a binary classifier, read as a probability
ReLUOutputs the input directly if positive, otherwise 0Hidden layers; fast and avoids some training problems
TanhSquashes any input to a value between −1 and 1Hidden layers where a zero-centred output helps
LinearPasses the input through unchangedOutput layer of a regression network (predicting a number)
激活函数它做什么典型用途
Sigmoid把任意输入压缩到 0 到 1 之间的一个值二分类器的输出层,读作一个概率
ReLU输入为正时直接输出,否则输出 0隐藏层;速度快,并能避免一些训练问题
Tanh把任意输入压缩到 −1 到 1 之间的一个值需要零中心化输出有帮助的隐藏层
线性原样传递输入,不做变换回归网络(预测一个数值)的输出层

Explainer

讲解

Forward and back propagation

前向传播与反向传播

Forward propagation is the input working its way forward: values enter at the input layer, pass through whichever hidden layers sit in between, and arrive at the output layer as a prediction. Back propagation is training: the error between the prediction and the true answer is calculated, then worked backward through the network to adjust every weight and bias slightly, so the next prediction is a little closer. One full pass through the entire training set is called an epoch; training repeats over many epochs.

前向传播是数据从输入层出发,经过隐藏层,流到输出层,产生一个预测。反向传播是训练过程:计算预测与真实答案之间的误差,然后把它反向传回网络,对每一个权重和偏置做微小调整,使下一次预测更接近正确答案一点。完整遍历一次整个训练集称为一个轮次(epoch);训练要经过许多轮次反复进行。

Try it yourself

动手试试

A greenhouse fan network

一个温室风扇网络

A tiny trained network decides whether to turn on a greenhouse cooling fan, from two inputs: temperature (0–1, scaled) and humidity (0–1, scaled). Drag the sliders and watch the forward pass, using fixed, already-trained weights and biases, decide the output.

一个微型的、已经训练好的网络,根据两个输入决定是否打开温室降温风扇:温度(0–1,已缩放)和湿度(0–1,已缩放)。拖动滑块,看看前向传播如何用固定的、已经训练好的权重和偏置来决定输出。

H1 has learned to weigh temperature heavily; H2 weighs humidity heavily. The output node combines both hidden nodes, so the fan can be triggered by high temperature alone, high humidity alone, or a combination of both being moderately high.

H1 学到了主要看重温度;H2 学到了主要看重湿度。输出节点把两个隐藏节点的结果结合起来,所以风扇既可能因为温度单独很高而启动,也可能因为湿度单独很高而启动,或者因为两者都适度偏高而启动。

Check your understanding

检验你的理解

What is the role of a bias term in a node of a neural network?

神经网络中一个节点的偏置项起什么作用?

Common mistake

常见错误

Recurring vocabulary slip 反复出现的术语混用

RecurringCalling the connection between two nodes "a weight". The link (connection) is the pathway itself; the weight is the number attached to that link, which scales the signal travelling along it. Two different links can carry two very different weights, or a link's weight can be zero (effectively no connection), so the link and its weight are not the same thing.

反复出现把两个节点之间的连接称为"一个权重"。连接(链接)是路径本身;权重是附着在这条连接上的数字,用来缩放沿着它传递的信号。两条不同的连接可以带有两个截然不同的权重,某条连接的权重甚至可以是 0(实际上等于没有连接),所以连接和它的权重不是同一回事。

✕

Wrong: "Each node is joined to the next layer by a weight, which carries the signal forward."

错误: "每个节点通过一个权重连接到下一层,权重把信号往前传递。"

✓

Right: "Each node is joined to the next layer by a link (connection). Every link has its own weight, a number that scales how strongly the signal travelling along that specific link influences the receiving node."

正确: "每个节点通过一条连接连到下一层。每条连接都有自己的权重,一个数字,用来缩放沿着这条特定连接传递的信号对接收节点的影响强度。"

Revision questions

复习题

Specimen-paper style. Write an answer, then reveal the marking points and mark yourself.

采用样卷风格。写下答案,然后展开评分要点给自己打分。

Question 1 · 3 marks 第 1 题 · 3 分

[3]Outline the three layers of a typical artificial neural network.

[3]概述典型人工神经网络的三种层。

Question 2 · 2 marks 第 2 题 · 2 分

[2]Distinguish between a weight and a bias in a neural network node.

[2]区分神经网络节点中的权重和偏置。

Question 3 · 4 marks 第 3 题 · 4 分

[4]Outline what happens during forward propagation and during back propagation.

[4]概述前向传播和反向传播期间各自发生了什么。

Question 4 · 2 marks 第 4 题 · 2 分

[2]State an activation function suited to the output layer of a regression network, and one suited to a binary classifier.

[2]说出一种适合回归网络输出层的激活函数,以及一种适合二分类器的激活函数。

Flashcards

记忆卡片

Active recall for this statement’s key terms.

针对本条考纲陈述关键术语的主动回忆练习。

Prototype render · grounded in the IB CS 2027 subject guide and the Hodder and Oxford IB CS 2027 texts for A4.3.8 · not yet wired to live routes