查看“︁学习率”︁的源代码
←
学习率
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{Expert needed|人工智能}} 在[[机器学习]]和[[统计学]]中,'''学习率'''({{Lang-en|Learning rate}})是优化算法中的一个可调参数,它决定了每次迭代的步长,使得优化向[[损失函数]]的最小值前进。<ref>{{cite book|first=Kevin P.|last=Murphy|title=Machine Learning: A Probabilistic Perspective|location=Cambridge|publisher=MIT Press|year=2012|isbn=978-0-262-01802-9|page=247|url=https://www.google.com/books/edition/Machine_Learning/NZP6AQAAQBAJ?hl=en&gbpv=1&kptab=sideways&pg=PA247}}</ref>它影响到新学习到的信息在多大程度上取代了旧信息,暗示了机器学习模型 "学习 "的速度。在[[自适应控制]]中,学习率通常被称为增益(Gain)。<ref>{{cite journal |last=Delyon |first=Bernard |date=2000 |title=Stochastic Approximation with Decreasing Gain: Convergence and Asymptotic Theory |journal=Unpublished Lecture Notes |publisher=Université de Rennes |citeseerx=10.1.1.29.4428}}</ref> 设置学习率需要在收敛速度和过冲(Overshooting)之间进行权衡。学习时的前进方向通常由损失函数的负梯度决定,而学习率决定了在这个方向上迈出多大一步。过高的学习率会使迈一大步,超过最小值;但过低的学习率会导致收敛速度变慢,或收敛于局部最小值。<ref>{{cite book|first1=Nikhil|last1=Buduma|first2=Nicholas|last2=Locascio|year=2017|title=Fundamentals of Deep Learning : Designing Next-Generation Machine Intelligence Algorithms|publisher=O'Reilly|isbn=978-1-4919-2558-4|page=21}}</ref> 为了加速收敛,防止振荡和陷入不理想的局部极小值,学习率在训练过程中往往按照计划或自适应改变。<ref name="variablelearningrate">{{cite book|title=Deep Learning : A Practitioner's Approach|url=https://archive.org/details/deeplearningprac0000patt|first1=Josh|last1=Patterson|first2=Adam|last2=Gibson|publisher=O'Reilly|year=2017|chapter=Understanding Learning Rates|pages=[https://archive.org/details/deeplearningprac0000patt/page/n281 258]–263|isbn=978-1-4919-1425-0}}</ref> == 学习率计划表 == 初始学习率速率可以参考系统默认值,也可以使用其他方式选择。学习率计划表在学习过程中改变学习率,最常见的是在epochs或iterations之间改变。学习率的改变通常由两个参数决定:衰减(Decay)和动量(Momentum)。目前常见的学习率修改方式是基于时间、基于步骤或基于指数的。<ref name="variablelearningrate" /> 衰减的作用是将学习过程稳定在一个好的、没有振荡的位置(当恒定学习率过高时,学习过程可能会在最小值附近震荡)。衰减率通常由超参数控制。 动量类似于从山上滚下来的球,我们希望球在最低点(对应于最低的误差)停留。当梯度方向长期一致时,动量可以加快学习速度(提高学习率),也能通过跳过局部最小值。动量由类似于球质量的超参数控制,而这一参数必须手动选择。当动量过大时,球会滚过希望找到的最小值;当动量过低时,它将不起作用。计算动量的公式比计算衰减的公式更复杂,但在常用的深度学习库(如Keras)中已经实现。 基于时间的学习计划表会根据前一个迭代的学习率改变学习率。考虑到衰减的因素,学习率更新公式为: <math>\eta_{n+1} = \frac{\eta_n }{1+dn}</math> 其中<math>\eta</math>是学习率。<math>d</math>是衰减参数,而<math>n</math>是迭代步骤。 基于步的学习计划表根据预先定义的步长改变学习率。通常定义为: <math>\eta_{n} = \eta_0d^{\left\lfloor\frac{1+n}{r}\right\rfloor}</math> 其中 <math>\eta_{n}</math>是在第<math>n</math>步的学习率,<math>\eta_0</math> 初始学习率,<math>d</math>是每次下降时学习率的变化程度(0.5代表减半),<math>r</math>对应下降率(即下降的频率,10代表每10此迭代下降一次)。向下取整函数(<math>\lfloor\dots\rfloor</math>)将小于1的数改为0。 指数式学习计划表与基于步的学习计划表类似,但使用的不是步,而是递减的指数函数。考虑到衰减的数学公式是: <math>\eta_{n} = \eta_0e^{-dn}</math> 其中<math>d</math>是衰减参数。 == 自适应学习率 == 学习率计划表存在的问题是,学习率变换方式取决于超参数,而超参数必须为手动选择。许多不同类型的自适应梯度下降算法解决这个问题(如Adagrad、Adadelta、RMSprop和Adam<ref>{{cite book|last1=Murphy|first1=Kevin|title=Probabilistic Machine Learning: An Introduction|url=https://probml.github.io/pml-book/book1.html|website=Probabilistic Machine Learning: An Introduction|access-date=10 April 2021|date=2021|publisher=MIT Press|archive-date=2021-04-11|archive-url=https://web.archive.org/web/20210411153246/https://probml.github.io/pml-book/book1.html|dead-url=no}}</ref>),这些算法通常内置于深度学习库。<ref>{{cite web |last1=Brownlee |first1=Jason |date=22 January 2019 |title=How to Configure the Learning Rate When Training Deep Learning Neural Networks |url=https://machinelearningmastery.com/learning-rate-for-deep-learning-neural-networks/ |access-date=4 January 2021 |website=Machine Learning Mastery |archive-date=2019-06-20 |archive-url=https://web.archive.org/web/20190620054417/https://machinelearningmastery.com/learning-rate-for-deep-learning-neural-networks/ |dead-url=no }}</ref> == 参考文献 == [[Category:机器学习]]
该页面使用的模板:
Template:Cite book
(
查看源代码
)
Template:Cite journal
(
查看源代码
)
Template:Cite web
(
查看源代码
)
Template:Expert needed
(
查看源代码
)
Template:Lang-en
(
查看源代码
)
返回
学习率
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息