1.tf.train.exponential_decay
tf.train.exponential_decay(
learning_rate,
global_step,
decay_steps,
decay_rate,
staircase=False,
name=None
)
decayed_learning_rate = learning_rate * decay_rate ^ (global_step / decay_steps)
If the argument staircase is True, then global_step / decay_steps is an integer division and the decayed learning rate follows a staircase function.
Example: decay every 100000 steps with a base of 0.96:
...
global_step = tf.Variable(0, trainable=False)
starter_learning_rate = 0.1
learning_rate = tf.train.exponential_decay(starter_learning_rate, global_step,
100000, 0.96, staircase=True)
# Passing global_step to minimize() will increment it at each step.
learning_step = (
tf.train.GradientDescentOptimizer(learning_rate)
.minimize(...my loss..., global_step=global_step)
)
---------------------
作者:koibiki
来源:CSDN
原文:https://blog.csdn.net/koibiki/article/details/83149664
版权声明:本文为博主原创文章,转载请附上博文链接!
|
|