Natural Language Processing · 免费预览

反向传播与训练

计算图、反向运行的链式法则、激活函数导数、输出端的交叉熵、梯度检验,以及一个训练好的 XOR 网络。

1. Backpropagation and Training

Backpropagation and Training

2. Backprop for a two-layer network

Backprop for a two-layer network

3. Backward differentiation in NumPy

Backward differentiation in NumPy

4. One backward step

On the graph d=4ad = 4a, e=d+ce = d + c, L=b⋅eL = b \cdot e with values a=3a = 3, b=2b = 2, c=4c = 4, compute ∂L∂a\frac{\partial L}{\partial a} by the chain rule. Answer as a decimal.

5. Sigmoid derivative at a point

Compute dσdz\frac{d\sigma}{dz} at z=−0.5z = -0.5, using σ(z)(1−σ(z))\sigma(z)(1 - \sigma(z)), and round to three decimals.

6. Through the ReLU gate

The output error is δ[2]=0.4\delta^{[2]} = 0.4, the output weight feeding hidden unit 1 is w=−0.5w = -0.5, and that hidden unit received pre-activation z=0.5z = 0.5. Compute δ[1]=w⋅δ[2]⋅1[z>0]\delta^{[1]} = w \cdot \delta^{[2]} \cdot \mathbb{1}[z > 0] as a decimal.

7. The error at the output

For a sigmoid output unit with cross-entropy loss, what is the error signal δ=∂L∂z\delta = \frac{{\partial L}}{{\partial z}} at the output logit, and why is it so clean?

8. Certifying the backward pass

A hand-written backward pass produces analytic gradients. Which procedure validates them, and what outcome should it produce?

进入交互式练习

免费注册 · 即时批改 · 自动安排间隔复习。

免费开始这门课