tensorflow - 为什么 Adam 优化器的 Keras 实现有衰减参数而 Tensorflow 没有?
问题描述
为什么 Adam 优化器的 Keras 实现有衰减参数而 Tensorflow 没有?这个论点有什么想法?
解决方案
为什么很难回答。
但是,当您的火车到达极限时,衰减很有趣。降低学习率可能会以更好的结果改进您的模型。但是机器学习就是关于测试的。
这个想法只是在每次批量更新中降低学习率的值。
这是 Keras 使用的公式:
lr = self.lr
if self.initial_decay > 0:
lr = lr * (1. / (1. + self.decay * K.cast(self.iterations, K.dtype(self.decay))))
基本上它的:
lr / (1 + decay*currentBatch) #considering currentBatch keeps incresing, not looping
推荐阅读
- python - Python中的递归:超过最大深度
- haskell - 编译 haskell-servant-cookbook 示例时的堆栈构建错误
- django - 无法使用 docker 数据库在 VS Code 中调试 django 应用程序:'无法将主机名“db”转换为地址:名称或服务未知'
- c - 为什么 if 语句不打印“做得好”,为什么循环会重复 questions()
- python - QMainWindow unexpectedly closes when I print a pandas DataFrame?
- python - JSON 数据中最常见(最多)的项目
- javascript - 将 python TensorFlow Layers 模型加载到 JavaScript 中
- jquery - 用 jQuery 替换 @page (CSS)
- python - 将 statsmodel.api 格式转换为 Scikit Learn 格式
- python - 如何修复“TypeError:需要一个整数”