如上图所示的两层神经网络,
单样本向量化: 多样本向量化:
for i=1 to 4:
z[1](i) = W[1](i) x(i) + b[1](i) Z[1] = W[1] X+ b[1]
(4,1) (4,3) (3,1) (4,1) (4,4) (4,3) (3,4) (4,4)
a[1](i) =sigmoid( z[1](i) ) A[1] = sigmoid( Z[1] )
(4,1) (4,1) (4,4) (4,4)
z[2](i) = W[2](i) a[1](i) + b[2](i) Z[2] = W[2] A[1] + b[2]
(1,1) (1,4) (4,1) (1,1) (1,4) (1,4) (4,4) [1,4]
a[2](i) =sigmoid( z[2](i) ) A[2] = sigmoid( Z[2] )
(1,1) (1,1) (1,4) (1,4)