简体   繁体   English

机器学习中的步长和学习率有什么区别?

[英]What is the difference between step size and learning rate in machine learning?

I am using TensorFlow to implement some basic ML code.我正在使用 TensorFlow 来实现一些基本的 ML 代码。 I was wondering if anyone could give me a short explanation of the meaning of and difference between step size and learning rate in the following functions.我想知道是否有人可以简短地解释以下函数中步长和学习率之间的含义和区别。

I used tf.train.GradientDescentOptimizer() to set the parameter learning rate and linear_regressor.train() to set the number of steps.我使用tf.train.GradientDescentOptimizer()来设置参数学习率和linear_regressor.train()来设置步数。 I've been looking through the documentation on tensorflow.org for these functions but I still do not have a complete grasp of the meaning of these parameters.我一直在查看 tensorflow.org 上关于这些函数的文档,但我仍然没有完全掌握这些参数的含义。

Thank you and let me know if there is any more info I can provide.谢谢你,如果我能提供更多信息,请告诉我。

In SGD, you compute the gradient for a batch and move the parameters in the direction of said gradient by an amount defined by the learning rate lr :在 SGD 中,您计算​​批次的梯度,并按照由学习率lr定义的量沿所述梯度的方向移动参数:

params=old_params - lr* grad 

where grad is the gradient of the loss wrt the params.其中grad是参数损失的梯度。

The step in tensorflow or similar libraries usually just denotes the number of such updates per epoch. tensorflow 或类似库中的step通常只表示每个 epoch 的此类更新数量。 So if you have step=1000 and lr=0.5 , you will be calling the pseudocode above 1000 times with lr=0.5 in each epoch.因此,如果您有step=1000lr=0.5 ,您将在每个时期以lr=0.5调用伪代码1000次以上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 学习率调度器和优化器之间有什么关系? - What is the relation between a learning rate scheduler and an optimizer? 这两种保存keras机器学习模型权重的方法有什么区别? - What is the difference between these two ways of saving keras machine learning model weights? 导入python机器学习包时,`orange`和`Orange`有什么区别? - What is the difference between `orange` and `Orange` when importing for the python machine learning package? 步骤而不是时代的学习率回调? - Learning Rate Callback on Step Rather Than Epoch? 这是什么:机器学习中的(冒号)Python? - What are this : (colons) in Machine Learning with Python? Keras的Adadelta Optimizer中的学习速率参数是什么? - What Is the Learning Rate Parameter in Adadelta Optimiser for in Keras? 机器学习工具 Docker 图像大小问题 - Machine Learning Tools Docker Image Size Issue 寻找降低机器学习分类误报率的想法 - Looking for ideas to lower the false positive rate in Machine Learning Classification 什么算法适合这种简单的机器学习问题? - What algorithms are suitable for this simple machine learning problem? clf在机器学习中是什么意思? - What does clf mean in machine learning?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM