前向:先保存中間計算Forward pass: save intermediate values
梯度回傳之前,先知道每層做過什麼。 / Save each layer’s computations before propagating derivatives.
加權輸入Pre-activation
wᵢℓ 從前一層 ℓ 連到本層 i;偏置可另加。 / The edge runs from ℓ to i.
激活輸出Activation
σ 是非線性函數;z 是送往下一層的值。 / Activation creates the next layer’s input.
保存後再回傳Cache, then backpropagate
保存 a、z 與損失;計算整批梯度後才更新參數。 / Compute all gradients before changing weights.