← COMP5511 全部讲次
Q09

Final 往年卷|I 延伸题与 Y24 简答

往年期末卷 I 延伸题与 Y24 简答:Markov 天气、分类损失、self-attention 与七道 Y24 简答,逐题折叠推算答案、英文答法与回查出处。非官方。

手机上宽表格可左右滑动;自测答案默认收起,点击题目下方按钮查看。

使用边界:期末复习,非官方材料。考试安排按课程公告整理,正式要求以讲师通知和课堂公告为准。本页按往年期末卷的题目整理,题面依解答重写、措辞可能与原卷不同,往年卷没有官方答案,解答均为推算答案;延伸题超出主课件,往年卷只说明以前怎么出题,不代表今年的题目和分值。

复习资料:考试安排与范围地图 · 专家系统与推荐系统 · Agent 与生成式 AI

先做题再看解析:G 往年卷:搜索、逻辑、概率 · H 往年卷:CNN 与神经网络 · I 往年卷:延伸与简答 · J 判断 1–25 · K 判断 26–50 · L 选择题 · M 问答:搜索、逻辑、概率 · N 问答:回归、聚类、神经网络 · O 问答:CNN、RNN 与拓展 · P 期中后新内容

怎么做:先只看题面,用英文写出答案要点,再展开核对;页码为 PDF 页序。

I 延伸题与 Y24 简答

题库只整理了解答,没有抄录原卷题面;下面的题面按解答整理,措辞可能与原卷不同。I1–I3 是延伸题,其中 I1、I2 两题合计 40 分;I4–I10 是 Y24 简答里其他页没有覆盖的部分。

I1 · Markov weather (F25 Q4, 15 marks)

The weather has two states in the order [Rain R, Sun S]. The transition matrix has rows for today and columns for tomorrow: T = [[.4, .6], [.3, .7]]. Weather is also observed on day 1 and day 10.

(a) Day 5 is rainy and day 7 is rainy. What is the probability that day 6 is sunny? (b) Day 7 is rainy and day 10 is sunny. What is the most likely joint weather sequence for days 8 and 9, and what is its posterior probability?

I1 · 查看答案与解析

答案(推算答案):

(a) 第 6 天晴的概率 = .6×.3 / (.6×.3 + .4×.4) = 9/17 ≈ .529412。已知第 5、7 天之后,第 1、10 天的观测不改变这一步。

(b) 比较第 8、9 天的四条路径:

  • RR = .4×.4×.6 = .096
  • RS = .4×.6×.7 = .168
  • SR = .6×.3×.6 = .108
  • SS = .6×.7×.7 = .294

最可能的是两天都晴,联合后验 = .294 / .666 ≈ .441441。

English: The Markov property says that the next state depends on the current state rather than earlier history. It does not make later evidence irrelevant when inferring an intermediate state. If days 5 and 7 are observed, the posterior for day 6 is proportional to the probability of reaching that state from day 5 times the probability of reaching the observed day 7 from it, followed by normalization.

易错点:(b) 问的是「最可能的联合序列」,不能拿两个逐日单独猜的结果去拼。Markov 性不表示后来的观测对推测中间状态无用。

回查:F25 Q4;此专题未在主课件中单独完整展开。

I2 · Classification losses (F24 Q7, 25 marks)

Labels are y ∈ {−1, +1} and f(x) = wᵀx. Let z = y·f(x); following the question’s convention, z ≥ 0 counts as correctly classified. Write the 0–1 loss, the perceptron loss and the least-squares loss in terms of z, and compare what each one penalizes.

I2 · 查看答案与解析

答案(推算答案):

  • 0–1 loss:分对为 0、分错为 1,所以总损失就是错误个数。
  • 感知机损失 max(0, −z):分对不罚,分错按负间隔大小罚。
  • 最小二乘 (f − y)² = (yf − 1)² = (z − 1)²(因为 y² = 1):分对但分数偏离 1 也罚。

English: Let z=yf(x) for labels ±1. Under the old question’s boundary convention, 0–1 loss is zero for z≥0 and one otherwise. Perceptron loss max(0,−z) penalizes negative margins by their magnitude. Least-squares loss equals (z−1)² and also penalizes correctly classified scores that differ from target margin 1. The 0–1 loss is unsuitable for ordinary gradient descent because it is flat almost everywhere and discontinuous at the boundary.

易错点:最小二乘的化简要用 y² = 1;零一损失几乎处处导数为零且边界不光滑,不适合普通梯度下降。

回查:F24 Q7;L01–L07 课件里没有单独成节。

I3 · Self-attention (Y24 Q28)

What does self-attention compute, and why can the same mechanism be used for both language and vision?

I3 · 查看答案与解析

答案(推算答案):自注意力计算 token 之间依内容而定的相互作用。词和图像块都可以表示成 token,所以同一机制能在语言和视觉里捕捉长距离关系。

English: Self-attention computes content-dependent interactions among tokens. Words and image patches can both be represented as tokens, allowing the same mechanism to capture long-range relationships in language and vision.

回查:底稿没有给页码,L01–L07 课件里没有单独成节;自注意力的通俗讲法见 L10b。

I4 · Admissible search algorithm (Y24 Q23, 2 marks)

When is a search algorithm called admissible?

I4 · 查看答案与解析

答案(推算答案):课件对算法的定义:有解时保证找到最小代价路径。

English: A search algorithm is admissible if it is guaranteed to find a minimum-cost solution path whenever a solution exists. For A*, an admissible heuristic never overestimates the remaining optimal cost.

易错点:问的是算法 admissible,不同于只定义 h 不高估。

回查:L02 p.58。

I5 · Burglary alarm BBN (Y24 Q22, 3 marks)

Draw the Bayesian belief network for the burglary alarm example: burglary, earthquake, alarm, Mary calls, John calls.

I5 · 查看答案与解析

答案(推算答案):盗窃和地震指向报警;报警分别指向 Mary 和 John 来电。

English: Use Burglary → Alarm ← Earthquake, with Alarm → MaryCalls and Alarm → JohnCalls. The alarm has burglary and earthquake as parents; each call depends on the alarm.

回查:BBN 方法在 L03a。

I6 · Three classic classifiers (Y24 Q24, 3 marks)

List three classic classifiers and briefly describe each.

I6 · 查看答案与解析

答案(推算答案):备选:逻辑回归线性评分接 sigmoid;朴素 Bayes 用类条件独立;决策树逐层按特征分支。

English: Logistic regression maps a linear score to a class probability. Naive Bayes applies Bayes’ rule with conditional feature-independence assumptions. A decision tree predicts a class by following feature-based tests from root to leaf.

易错点:决策树课件没有展开,这部分是补充。

回查:逻辑回归和朴素贝叶斯见 L06。

I7 · Traditional ML vs deep learning (Y24 Q25, 3 marks)

What is the difference between traditional machine learning and deep learning?

I7 · 查看答案与解析

答案(推算答案):传统 ML 常手工设计特征;DL 用多层网络自动学层次特征,通常更需要数据和计算。

English: Traditional machine learning often relies on handcrafted features. Deep learning learns hierarchical representations from data using multiple neural-network layers, reducing manual feature engineering but often requiring more data and computation.

回查:L06。

I8 · Deep networks before 2010 (Y24 Q26, 3 marks)

Why were deep networks difficult to train before 2010?

I8 · 查看答案与解析

答案(推算答案):算力和数据有限;饱和激活导致梯度消失;优化和初始化也更困难。

English: Deep networks were difficult to train because computing resources and large datasets were limited, while saturating activations caused vanishing gradients. Better hardware, optimization and nonsaturating activations such as ReLU made deeper learning more practical.

回查:L06。

I9 · Improving DNN generalization (Y24 Q27, 3 marks)

Give three methods to improve the generalization of a deep neural network.

I9 · 查看答案与解析

答案(推算答案):更多有代表性数据、L2 等正则、减小过大模型;这是课内可答的三项。

English: Use more representative training data, apply appropriate regularization such as L2, and reduce excessive model capacity. Select these settings on validation data rather than repeatedly tuning on the test set.

回查:L04c。

I10 · Uses of generative models (Y24 Q30, 3 marks)

What are generative models useful for? Give three examples.

I10 · 查看答案与解析

答案(推算答案):补充用例:生成图像/文本,补全缺失内容,合成训练数据。

English: Generative models can create new images or text, complete missing or corrupted data, and produce synthetic training examples for data augmentation. They model data distributions rather than only predicting class boundaries.

易错点:课件没有专门讲生成模型的用途,三个例子是补充。

回查:Y24 Q30;底稿没有给讲次页码。

下一页 →
Q10 Final 题库|J 判断题 1–25

个人整理的学习笔记,不是官方材料;数字与结论以课件和讲师为准。