黑马程序员技术交流社区

标题: 【上海校区】tensorflow 笔记 [打印本页]

作者: 梦缠绕的时候    时间: 2018-10-31 09:14
标题: 【上海校区】tensorflow 笔记
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
版权声明:本文为博主原创文章,转载请附上博文链接!


作者: 不二晨    时间: 2018-10-31 14:28

作者: 魔都黑马少年梦    时间: 2018-11-1 16:13





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2