首页 > 解决方案 > 为什么 Adam 优化器的 Keras 实现有衰减参数而 Tensorflow 没有?

问题描述

为什么 Adam 优化器的 Keras 实现有衰减参数而 Tensorflow 没有?这个论点有什么想法?

标签: tensorflowneural-networkkerasdeep-learning

解决方案


为什么很难回答。

但是,当您的火车到达极限时,衰减很有趣。降低学习率可能会以更好的结果改进您的模型。但是机器学习就是关于测试的。

这个想法只是在每次批量更新中降低学习率的值。

这是 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    

推荐阅读