梯度检验与高级优化
From Ufldl
Line 68: | Line 68: | ||
- | 迄今为止,我们的讨论都集中在使用梯度下降法来最小化 <math>\textstyle J(\theta)</math>。如果你已经实现了一个计算 <math>\textstyle J(\theta)</math> 和 <math>\textstyle \nabla_\theta J(\theta)</math> 的函数,那么其实还有更精妙的算法来最小化 <math>\textstyle J(\theta)</math>。举例来说,可以想象这样一个算法:它使用梯度下降,并能够自动调整学习速率 <math>\textstyle \alpha</math>,以得到合适的步长值,最终使 <math>\textstyle \theta</math> | + | 迄今为止,我们的讨论都集中在使用梯度下降法来最小化 <math>\textstyle J(\theta)</math>。如果你已经实现了一个计算 <math>\textstyle J(\theta)</math> 和 <math>\textstyle \nabla_\theta J(\theta)</math> 的函数,那么其实还有更精妙的算法来最小化 <math>\textstyle J(\theta)</math>。举例来说,可以想象这样一个算法:它使用梯度下降,并能够自动调整学习速率 <math>\textstyle \alpha</math>,以得到合适的步长值,最终使 <math>\textstyle \theta</math> 能够快速收敛到一个局部最优解。还有更妙的算法:比如可以寻找一个Hessian矩阵的近似,得到最佳步长值,使用该步长值能够更快地收敛到局部最优(和牛顿法类似)。此类算法的详细讨论已超出了这份讲义的范围,但是L-BFGS算法我们以后会有论述(另一个例子是共轭梯度算法)。你将在编程练习里使用这些算法中的一个。使用这些高级优化算法时,你需要提供关键的函数:即对于任一个 <math>\textstyle \theta</math>,需要你计算出 <math>\textstyle J(\theta)</math> 和 <math>\textstyle \nabla_\theta J(\theta)</math>。之后,这些优化算法会自动调整学习速率/步长值 <math>\textstyle \alpha</math> 的大小(并计算Hessian近似矩阵等等)来自动寻找 <math>\textstyle J(\theta)</math> 最小化时<math>\textstyle \theta</math> 的值。诸如L-BFGS和共轭梯度算法通常比梯度下降法快很多。 |
+ | |||
+ | |||
+ | ==中英文对照== | ||
+ | |||
+ | off-by-one error 缺位错误 | ||
+ | |||
+ | bias term 偏置项 | ||
+ | |||
+ | numerically checking 数值检验 | ||
+ | |||
+ | numerical roundoff errors 数值舍入误差 | ||
+ | |||
+ | significant digits 有效数字 | ||
+ | |||
+ | unrolling 组合扩展 | ||
+ | |||
+ | learning rate 学习速率 | ||
+ | |||
+ | Hessian matrix Hessian矩阵 | ||
+ | |||
+ | Newton's method 牛顿法 | ||
+ | |||
+ | conjugate gradient 共轭梯度 | ||
+ | |||
+ | step-size 步长 | ||