Lecture 2 Gradient descent

本文详细介绍了由斯坦福大学Andrew Ng教授讲解的梯度下降算法原理。通过此算法,我们能够找到使损失函数最小化的参数值,从而得到最佳拟合线。文章还解释了梯度的方向及其变化对算法收敛速度的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#This was a lecture of Andrew NG on Couresera websiteMachine Learning of Stanford University.#
#This was a note noted by WONG Zinhoo, Reproduced please specify the Source and the original link#
                        Lecture 2 Gradient descent

Algorithm Ideal

We already knew that the  graphic function described the distance between the line and the points in different graphic condition. 
We want find out the best line which conform the samples best, to accomplish this aim we just need to make the J function minimum.
graphic
This is the basic methods:
graphic
As pic<1> show, the red parts are the Maxima peaks and the Minimum is in the valley.
graphic
                   Pic<1>

Gradient descent algorithm

graphic
All the  graphic should be simultaneous updated, that means that we changed the  graphic group by group rather than by single.
Function analysis:
graphic
when the original  graphic is in the slope:
                 graphic
Theorem: the gradient’s direction is same to the normal direction, and the length of the gradient equal to the rate of the change.

Base on the theorem of gradient the slope steeper the length of gradient much longer; and the value of  graphic become smaller. 
With this process the new  graphic become smaller:
graphic
Because                the value of gradient   ∝  θ
So gradient become smaller: 
                                                 graphic
Repeat this process, the  graphic will go to the local bottom (local minimum).

More simple condition: the single  θ condition:
                            graphic
As we approach a local minimum, gradient descent will automatically take smaller steps. So, no need to decrease α over time: 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值