gpt4 book ai didi

Tensorflow 对象检测 : use Adam instead of RMSProp

转载 作者:行者123 更新时间:2023-12-03 18:14:35 26 4
gpt4 key购买 nike

我正在用这个 [.config 文件][1] 训练一个 CNN:

rms_prop_optimizer: {
learning_rate: {
exponential_decay_learning_rate {
initial_learning_rate: 0.004
decay_steps: 800720
decay_factor: 0.95
}
}
momentum_optimizer_value: 0.9
decay: 0.9
epsilon: 1.0
}

}
As you can see there is a rms_prop as optimizer. What if I would like to use Adam? How am I supposed to edit this file?

最佳答案

如果我是对的,您正在尝试将 object_detection 模型与 Tensorflow 提供的预训练网络一起使用,对吗?
然后,如果你懂一点编程,你可以看看models/research/object_detection/builders/optimizer_builder.py,看看哪些是可以使用的优化器,以及哪些参数。
相反,如果您只想要一个开箱即用的解决方案,我就是这样做的:

optimizer {
# momentum_optimizer {
adam_optimizer: {
learning_rate: {
manual_step_learning_rate {
initial_learning_rate: .0002
schedule {
step: 4500
learning_rate: .0001
}
schedule {
step: 7000
learning_rate: .00008
}
schedule {
step: 10000
learning_rate: .00004
}
}
}
# momentum_optimizer_value: 0.9
}
use_moving_average: false
}

在我的(小)经验中,我注意到使用与 momentum_optimizer 相同的 learning_experience 会使学习速度过快和/或带来 NaN 损失,因此我通常将其减少 10 倍或更多。我现在正在尝试。 :)

关于Tensorflow 对象检测 : use Adam instead of RMSProp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51915803/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com