一句话定义:先写规范中文名称与英文名称,再用一句中文说明概念边界。
目前复习进度判断
神经网络核心基础
激活函数、前向传播、损失函数、反向传播、梯度下降与线性网络。
概率与信息论
贝叶斯推断(Bayesian Inference)、熵(Entropy)、KL 散度、高斯微分熵、高斯 KL 散度与 Wasserstein 距离。
神经网络训练基础
Softmax、反向传播(Backpropagation)、隐藏单元动态(Hidden Unit Dynamics)与线性网络(Linear Network)。
卷积神经网络与训练技术
卷积神经网络(CNN)、权重初始化、批量归一化、残差网络(ResNet)与密集连接网络(DenseNet)。
强化学习基础
策略(Policy)、状态价值函数、动作价值函数、贝尔曼方程与 Q-learning 更新。
序列模型与生成模型
RNN、LSTM、注意力机制、Word2Vec、自动编码器(AE)、变分自动编码器(VAE)与生成对抗网络(GAN)。
根据当前掌握情况重新评估:已覆盖约 80%,剩余是基础补漏
第一梯队 · 必须补
- Perceptron Learning Algorithm · 计算与更新
- Bayes theorem · 条件概率计算
- XOR + Threshold Network · 不可线性分
第二梯队 · 高可能
- Hidden Unit Dynamics / Hidden Space
- Maximum Likelihood (MLE) vs Bayesian
第三梯队 · 保持熟悉
- Linear Perceptron / Threshold Activation
- Gaussian KL / Wasserstein
第一部分 · 神经网络基础(Neural Network Basics)
一句话
Backpropagation calculates gradients of the loss with respect to network parameters using the chain rule.
一句话
Gradient descent updates parameters using calculated gradients to reduce the loss.
一句话
Nonlinear activation functions allow neural networks to learn complex nonlinear patterns.
隐单元怎样改变?
Hidden Unit Dynamics 关注训练中隐藏单元的 pre-activation、activation 与 gradient 如何随 input 和 weights 变化。饱和、dead ReLU 与梯度消失都是其动态表现。
多层线性网络的表达能力
Linear Network 中若每层都只做线性变换,则 W₃(W₂(W₁x)) = Wx;深度不会增加非线性表达能力。这也是 hidden layers 之间需要 nonlinear activation 的直接理由。
Softmax
没有 Activation
基础补漏 · Perceptron、XOR 与 Hidden Space
从 score 到 prediction
A perceptron computes a weighted sum, applies a threshold, and updates its weights when the prediction is wrong.
ŷ = 1 if s ≥ 0, otherwise 0threshold 的具体位置可不是 0,但可吸收进 bias。
统一记法
- target=1 但预测 0:沿 +x 方向移动 weights。
- target=0 但预测 1:沿 −x 方向移动 weights。
- 若标签用 −1/+1,对 misclassified point 常写 w ← w + ηtx。
计算题固定流程
XOR Truth Table
| x₁ | x₂ | XOR |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
XOR + Threshold Network
XOR is not linearly separable:一条直线无法把两个 positive points 与两个 negative points 分开,所以单个 linear perceptron 做不了。Hidden layer 可以先组合多条 boundaries,把 input 重表示后再线性分类。
Hidden Unit Dynamics:“重新表示数据”是什么?
第二部分 · 训练问题(Training Problems)
Overfitting:一句话
The model performs well on training data but poorly on unseen data.
- Dropout
- L2 regularization
- Early stopping
- Data augmentation
一句话
Randomly disables units during training to reduce co-adaptation and overfitting.
- Training:随机 mask 部分 units。
- Testing:不再随机关闭;使用完整网络。
一句话
Initializes weights at an appropriate scale to reduce vanishing or exploding activations and gradients.
关键词:训练开始前,直接作用于 weights。Xavier / He 根据 fan-in / fan-out 选择尺度。
一句话
Normalizes activations using mini-batch statistics, then applies learnable scale and shift to stabilize training.
关键词:主要管 activation,使用 γ / β 恢复可学表达能力。
一眼分清
- Initialization:训练开始前设置 weight 尺度。
- BatchNorm:训练过程中处理 activations,并学习 γ / β。
不要这样说
- ❌ Initialization “找到最优 weight”。
- ✓ 它只选择合理的初始范围。
- ❌ BatchNorm 只是把 weights 归一化。
- ✓ 它标准化中间 activations。
第三部分 · 卷积神经网络(CNN)
局部感受野
神经元每次只看 input 的局部区域,适合捕捉边缘、纹理和局部组合。
权重共享
同一个 filter 扫描所有位置,大幅减少 parameters,并在不同位置检测同一 pattern。
位置移动
卷积本身更严格地说具有 translation equivariance;输入移动,feature map 随之移动。Pooling / global aggregation 才能增强近似 translation invariance。
Convolution Output
Filter Parameters
基础流程
Input → Convolution → Activation → Pooling / Downsampling → 更高层 features → Head。深层逐渐从边缘组合出更抽象的结构。
与 Dropout 不同
Pooling 在 spatial dimensions 上聚合局部特征,常用于下采样和增强局部不变性;它不是随机关闭 neuron 的 regularization。
Shortcut Connection
Shortcut connections provide a direct path for information and gradient flow, allowing deeper networks to train.
Dense Connectivity
DenseNet 将每一层的 feature maps 传给后面所有层,通常用 concatenation 而非 addition,促进 feature reuse 与 gradient flow。
为什么参数少?
CNN 并非天生“网络小”;它相对 fully connected image model 参数少,主要来自 local connectivity 和 weight sharing。
秒答
Output depth 等于 number of filters。每个 filter 产生一个 output channel / feature map。
第四部分 · 概率与信息论(Probability & Information Theory)
从 prior 到 posterior
Bayes' rule updates prior belief using observed evidence.
一句话
Entropy measures the uncertainty of a probability distribution. 分布越均匀,离散 entropy 通常越大。
一句话
KL divergence measures the expected log-density mismatch from a reference distribution p to an approximation q. 左边 p 负责加权。
贝叶斯推断(Bayesian Inference):先有先验,再用数据更新
Bayesian inference combines prior knowledge with observed data to obtain a posterior distribution.
贝叶斯推断把先验知识(prior knowledge)和观察到的数据(observed data)结合起来,得到后验分布(posterior distribution)。
Bayes theorem
硬币中的 Likelihood
Maximum Likelihood (MLE) vs Bayesian
核心问题
Maximum Likelihood (MLE)“哪一个 parameter value 最能解释已观察数据?”
贝叶斯推断(Bayesian Inference)“加入先验后,参数的完整后验分布是什么?”
输出
point estimateMLE chooses the parameters that maximize the likelihood of observed data. 例如 100 次抛币有 60 次正面,则 θ̂MLE=0.6。
DistributionBayesian 把 parameter 也当作不确定量,输出 p(θ|D),可表达“最可能在哪里”以及“有多不确定”。
Discrete Entropy
KL Divergence
Gaussian Differential Entropy
Gaussian KL
Gaussian Wasserstein-2
KL Direction
第五部分 · 强化学习(Reinforcement Learning)
Policy π(a|s)
Policy tells the agent how to choose an action in each state. 它可以是 deterministic 动作,也可以是 action distribution。
Value Function V(s)
V(s) is the expected discounted return starting from state s and following a policy.
Q Function Q(s,a)
Q(s,a) is the expected discounted return after taking action a in state s and then following a policy.
γ
Controls how strongly future rewards affect the current return. 小 γ 更看当下;大 γ 更看未来。
Bellman Expectation Equation
Q-learning TD Target
Q-learning Update
V 与 Q
Experience Replay:一句话
Stores past transitions and samples mini-batches to reduce temporal correlation and reuse data. 它使 DQN 的更新更接近 i.i.d. mini-batch training。
一句话
Decouples action selection from action evaluation to reduce max-operator overestimation. Double DQN 常用 online network 选 action,target network 评估该 action。
第六部分 · 序列模型与词向量(Sequence Models & Word Vectors)
长程依赖
RNNs can suffer from vanishing or exploding gradients when learning long-range dependencies. 问题来自 BPTT 中 Jacobians 的反复相乘,不是简单的“memory 小”。
一句话
LSTM uses gates and a cell state to control information flow and preserve useful long-term information.
- Forget gate:保留/忘记旧 cell information
- Input gate:写入新 information
- Output gate:决定暴露的 hidden output
一句话
Attention computes relevance weights so the model can focus on important parts of the input. 它是加权聚合,不是硬删除其他 tokens。
Positional Encoding:为什么需要?
Self-attention alone has no built-in notion of token order, so positional information must be added or encoded.
Context → Center
Predict the target / center word from surrounding context words. 口诀:大家猜中间。
Skip-Gram:Center → Context
Predict surrounding context words from the target / center word. 口诀:中间猜大家。
预测是手段
Word2Vec 通过 context prediction task 学习 dense embeddings。最终要保留的是 weight matrix 中的 word vectors,而不是 prediction task 本身。
一句话
SVD compresses a high-dimensional co-occurrence matrix into lower-dimensional word representations.
Score → Probability
对 candidate words 的 scores 应用 Softmax,训练时提高真实 context word 的 probability;大 vocabulary 下常用 Negative Sampling 等方法加速。
第七部分 · 生成模型(Generative Models)
一句话
An encoder maps input to a latent representation and a decoder reconstructs the input. 普通 AE 的 encoder 通常为每个 input 给出一个 deterministic latent vector。
一句话
VAE learns a conditional probability distribution in latent space and samples latent variables for reconstruction/generation. Encoder 输出 μ 与 variance / log-variance,参数化 q(z|x)。
一句话
The generator creates fake samples while the discriminator distinguishes real samples from generated ones. 二者进行 adversarial training;这与 Double Q 的动作选择/评估解耦无关。
一个确定点
x → z → x̂;主要目标是 reconstruction。
一个 distribution
x → (μ,σ) → sample z → x̂;目标同时包含 reconstruction 与 KL regularization。
七组必须分清的概念
反向传播与梯度下降(Backpropagation vs Gradient Descent)
反向传播使用链式法则计算梯度。
梯度下降使用梯度更新参数。
权重初始化与批量归一化(Weight Initialization vs Batch Normalization)
权重初始化在训练前设置权重的初始尺度。
批量归一化在训练中标准化激活值,并学习缩放与平移参数。
丢弃法与池化(Dropout vs Pooling)
Dropout是一种正则化方法;训练时随机屏蔽神经元。
池化用于空间聚合与降采样,处理特征图的局部区域。
自动编码器与变分自动编码器(Autoencoder vs VAE)
AE通常输出确定性的潜在向量,并直接优化重构误差。
VAE参数化 q(z|x),采样潜变量,并加入 KL 约束。
生成对抗网络与 Double Q(GAN vs Double Q)
GAN通过生成器与判别器进行对抗训练。
Double Q解耦动作选择与动作评估,以减少 Q 值过估计。
状态价值与动作价值(V(s) vs Q(s,a))
V(s)表示从状态 s 出发的期望回报。
Q(s,a)表示在状态 s 先执行动作 a 后的期望回报。
KL 方向(KL direction)
D(p‖q)由 p 加权,对 q 在 p 有概率质量的位置给出零概率非常敏感。
D(q‖p)由 q 加权,优化行为不同;方向不能随意交换。
最容易错 TOP 10
❌ Backprop 更新 weight
✓ Backprop 算 gradient;optimizer 更新 weight。
❌ BatchNorm 管 weight
✓ BatchNorm 主要标准化 activation。
❌ Weight Initialization 找最优 weight
✓ 它只选择合理的初始范围。
❌ Dropout 减少图片大小
✓ Dropout 训练时随机 mask units;Pooling 才会聚合 spatial region。
❌ VAE 只输出一个 latent 变量
✓ VAE encoder 输出分布参数,常为 mean + variance / log-variance。
❌ Double Q 是生成和判别
✓ GAN 才是 Generator / Discriminator;Double Q 解耦选择与评估。
❌ KL 是普通距离
✓ KL 不对称,不满足 metric 的对称性。
❌ Q 和 V 一样
✓ Q 多一个 action 条件;V 只条件于 state。
❌ CNN 一定参数很多
✓ 卷积通过 local connectivity 和 weight sharing 减少参数。
❌ RNN 忘记只是因为 memory 小
✓ 长程依赖的关键训练问题是 BPTT 中的 vanishing gradient。
“可能会误导”或“可能不懂”的地方
1. “Testing 时 Dropout 全部打开”还少了什么?
严谨版:inference 时不再随机 mask。常见 inverted dropout 已在 training 时按 1/(1−p) 缩放,因此 testing 时无需再缩放。
2. BatchNorm 不是 train / test 完全一样
严谨版:training 使用 mini-batch mean / variance;inference 通常使用训练期累积的 running mean 和 running variance。
3. CNN 是 invariant 还是 equivariant?
严谨版:convolution 对平移主要是 equivariant。Pooling、stride 和 global aggregation 可带来一定的近似 invariance,但不应笼统说 CNN 对任意移动完全不变。
4. Conv output 公式为什么要 floor?
严谨版:只有 filter 完整落在 padded input 上才算一个位置。当 stride 不整除时,位置数必须向下取整;还要注意 dilation。
5. “Entropy 越平均越大”的边界
严谨版:对固定有限类别数的离散分布,uniform distribution 取最大 entropy。Gaussian 这里讨论的是 differential entropy,性质不能全部照搬。
6. KL 不只是“差多少”
严谨版:KL 是对 log density ratio 的期望,方向决定由谁加权。D(p‖q) 与 D(q‖p) 对 mode covering / seeking 的倾向可不同。
7. Bellman 简式不是通用式
严谨版:V(s)=r+γV(s′) 适合说明 deterministic one-step intuition。一般情况必须对 policy actions 与 environment transitions 取 expectation。
8. Q-learning 右边是 target,不是 update 全部
严谨版:r+γmax Q(s′,a′) 是 TD target。完整的 tabular update 还需要旧 Q、learning rate α 和 TD error。
9. RNN 是“can suffer”,不是必然完全失败
严谨版:梯度消失/爆炸取决于 recurrent Jacobian、activation、参数与 sequence length。LSTM / GRU、gradient clipping 和合理 initialization 都可缓解。
10. VAE 不是“直接输出随机数”
严谨版:encoder 输出分布参数,通过 reparameterization z=μ+σ⊙ε 采样,使 gradient 能穿过 sampling path。
11. Attention “聚焦”不等于只看一个 token
严谨版:attention 通常对多个 values 做加权和。权重可以集中,也可以分散;其目的是按相关性聚合信息。
12. Double Q 与 target network 不是同一定义
严谨版:target network 主要稳定 bootstrap target;Double Q 的核心是解耦 selection 和 evaluation。Double DQN 常将两者结合。