是否有一种方法可以在使用KERAS的ReDucelRonplateau回调时重置每个折叠的学习率?
由于标题具有自我描述性,我正在寻找一种在每个折叠上重置学习率(LR)
的方法。 reducelronplateau
keras
的回调管理lr
。
As the title is self-descriptive, I'm looking for a way to reset the learning rate (lr)
on each fold. The ReduceLROnPlateau
callback of Keras
manages the lr
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有可重现的例子,我只能提出建议。如果您查看 REDUCELRONPLATEAU 您可以获得一些灵感并创建一个自定义回调以重置培训开始时的学习率:
因此,使用此回调,您可以使用for for loop训练:
如果这不起作用(由于张力频率版本)您可以尝试使用
tf.keras.backend
喜欢的默认学习率,我也建议您查看此 post ,以获取更多参考。
With no reproducible example I can only make a suggestion. If you take a look at the source code of ReduceLROnPlateau you can get some inspiration and create a custom callback to reset the learning rate on the beginning of training:
So with this callback you train using a for loop:
If this does not work (due to tensorflow versions) you can try assigning the default learning rate using the
tf.keras.backend
like so:Also I would suggest taking a look at this post, for more references.
以下是可以完成这项工作的自定义回调。在培训开始时,回调提示用户输入初始学习率的值。
在Model.Fit设置参数
注意:模型是您编译的模型的名称,Rlronp是您的REDUCELRONPLATEAU回调的名称。运行模型时,您将是
提示
below is a custom callback that will do the job. At the start of training, the callback prompts the user to enter the value of the initial learning rate.
in model.fit set the parameter
Note: model is the name of your compiled model, and rlronp is the name of your ReduceLROnPlateau callback. When you run model.fit you will be
prompted with