Deep Learning
6.5 Back-Propagation
6.5.1 Computational Graphs
Here, we use each node in the graph to indicate a variable.
If a variable y is computed by applying an operation to a variable x, then we draw a directed edge from x to y.
6.5.2 Chain Rule of Calculus
We can generalize this beyond the scalar case.
Suppose that x∈Rm,y∈Rn, g:Rm→Rn,f:Rn→R. If y=g(x),z=f(y). Then
\partxi\partz=i∑\partyi\partz\partxi\partyi
In vector notation, this may be equivalently written as
∇yz=\party\partf(y)=\party1\partf(y)\party2\partf(y)...\partyn\partf(y)\partx\party=\partx\partg(x)=\partx1\partg1(y)\partx2\partf(y)...\partxm\partf(y).........\partx1\partgm(y)\partx2\partgm(y)\partxm\partgm(y)
The second matrix is the transposition of Jg Jacobian matrix of g
∇xz=\partx\party∇yz=JgT∇yz
The back-propagation algorithm consists of performing such a Jacobian-gradient product for each operation in the graph.
多层感知机
X∈Rn×d 表示n个样本的小批量, 其中每个样本具有d个输入特征。 对于具有h个隐藏单元的单隐藏层多层感知机, 用H∈Rn×h表示隐藏层的输出。隐藏层权重是W(1)∈Rd×h,b(1)∈Rh, 输出层则是W(2)∈Rh×q,b(2)∈Rq。所以输出O∈Rn×q
H=σ(XW(1)+(b(1))T)O=HW(2)+(b(2))T
Comments
No approved comments yet.
Your display name and plain-text comment become public only after owner approval. No account or email is required.