手計算による誤差逆伝播:出力層誤差項とパラメータ勾配
Agent支援エンジニアリングチェック
前提条件
第34日のN1順伝播表:$o=3.1255$、$L=4.5179$。
学習目標
N1の線形出力と二乗損失 $L=(o - y)^2$ に連鎖律を適用し、出力誤差項と3つの出力層勾配を求める。
手順
先に記号で導出し、その後で数値を代入する。出力は $o=w_{o1}a_1+w_{o2}a_2+b_o$ という線形単位で、損失に $1/2$ の係数はない。
1. $\delta_o=\partial L/\partial o=2(o-y)$。
2. 局所入力微分は $w_{o1}$ と $w_{o2}$。
3. 局所パラメータ微分は $a_1$、$a_2$、$1$。各勾配は上流の $\delta_o$ と局所微分の積になる。
4. $a_1=0.8741$、$a_2=-0.9757$、$o=3.1255$、$y=1.0$ を使い、答えを見る前に予測する。
演習と予測記録
1. $\delta_o$ を導出する。2. 出力重み2個とバイアスの勾配を求める。3. バイアスの局所微分が1となる理由を述べる。4. $a_1$ への勾配が $z_1$ に届く前に通る活性化微分を答える。
$\delta_o=2(3.1255-1.0)=4.2511$。各重みの局所微分は対応する活性値、バイアスの局所微分は1。
$\delta_o=4.2511$。$\partial L/\partial w_{o1}=4.2511\times0.8741=3.7157$、$\partial L/\partial w_{o2}=4.2511\times(-0.9757)=-4.1480$、$\partial L/\partial b_o=4.2511$。バイアスは係数1で加算される。$a_1$ に届く勾配は $\delta_o w_{o1}=4.2511$ で、さらに $\tanh'(z_1)=1-a_1^2$ を掛ける。
答えを見ずに3勾配(3.7157、-4.1480、4.2511)を $10^{-3}$ 以内で再現し、上流×局所の構造を説明する。
公式ソースリソースと権利証跡
Neural Networks and Deep Learning: How the backpropagation algorithm works
該当セクション・タイムスタンプ: The four fundamental equations of backpropagation
検証バージョンと日付: Online book (Verified: 2026-10-30)
Clear four-equation derivation of backpropagation with scalar and matrix notation.
Matrix multiplication and the multivariable chain rule from Days 19-24.
All four backprop equations and derivations are self-contained within the lesson text.
比較対象候補リソースと選定評価 (2)
Comprehensive graduate reference, but heavier tensor notation than needed for first MLP derivations.
Modular computational graph view; used as secondary source on Days 35-36.
CS231n: Backpropagation and Intuitions
該当セクション・タイムスタンプ: Patterns in backward flow
検証バージョンと日付: Course notes (Verified: 2026-10-30)
Modular local-gradient interpretation (gate operations: add, multiply, max) and gradient flow intuition.
Multivariable calculus and basic Python.
Local gate definitions and circuit flow diagrams in the lesson provide full coverage.
比較対象候補リソースと選定評価 (2)
Raw circuit view; CS231n notes are more structured with explicit gate derivations.
Top-down approach; CS231n bottom-up modular view matches our first-principles curriculum.