One hidden layer Neural Network - Gradient descent for neural networks

这篇博客详细介绍了Andrew Ng在Coursera课程中关于神经网络与深度学习的第3.9节内容——梯度下降在神经网络中的应用。文章通过计算图展示了单个和多个训练样本时的反向传播过程,并提供了关键变量的维度检查,以确保计算的准确性。对于单个训练样本,给出了详细的反向传播公式;而对于多个样本,解释了批量梯度下降的计算方式。这些内容对理解神经网络的训练过程极具帮助。
摘要由CSDN通过智能技术生成

The notes when study the Coursera class by Mr. Andrew Ng "Neural Networks & Deep Learning", section 3.9 "Gradient descent for neural networks". It shows the computation graph for NN, how to compute back propagation of NN when there is one and multiple training examples. Share it with you and hope it helps!
————————————————

For an one hidden layer NN as figure-1, its computation graph is as what shown in figure-2:

figure-1

 

figure-2

 

  •  When there is just one training example, the back propagation for NN is:
figure-3

 

Note: we can check the dimension of some variables to make sure the calculation is correct. Take the computation of dz^{[1]} as example:

W^{[2]} is n^{[2]}\times n^{[1]}=1 \times 4, (W^{[2]})^{T}is n^{[1]} \times n^{[2]}=4 \times 1

dz^{[2]} is 1 x 1

W^{[2]T}dz^{[2]} is 4 x 1

g^{[1]'}(z^{[1]}) is 4 x 1

* is dot element multiplication, thus the final dz^{[1]} is 4 x 1

  • When there are m training examples, the back propagation for NN is:

 

figure-4

 

 <end>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值