tf.train.exponential_decay(learning_rate, global_, decay_steps, decay_rate, staircase=True/False)

例如:

import tensorflow as tf;
import numpy as np;
import matplotlib.pyplot as plt;learning_rate = 0.1
decay_rate = 0.96
global_steps = 1000
decay_steps = 100global_ = tf.Variable(tf.constant(0))
c = tf.train.exponential_decay(learning_rate, global_, decay_steps, decay_rate, staircase=True)
d = tf.train.exponential_decay(learning_rate, global_, decay_steps, decay_rate, staircase=False)T_C = []
F_D = []with tf.Session() as sess:for i in range(global_steps):T_c = sess.run(c,feed_dict={global_: i})T_C.append(T_c)F_d = sess.run(d,feed_dict={global_: i})F_D.append(F_d)plt.figure(1)
plt.plot(range(global_steps), F_D, 'r-')
plt.plot(range(global_steps), T_C, 'b-')plt.show()

分析:

初始的学习速率是0.1,总的迭代次数是1000次,如果staircase=True,那就表明每decay_steps次计算学习速率变化,更新原始学习速率,如果是False,那就是每一步都更新学习速率。红色表示False,绿色表示True。

结果:

tf.train.exponential_decay的用法相关推荐

  1. tf.train.exponential_decay

    函数 - tf.train.exponential_decay tf.train.exponential_decay(learning_rate, global_step, decay_steps, ...

  2. tensorflow之tf.train.exponential_decay()指数衰减法

    exponential_decay(learning_rate,  global_steps, decay_steps, decay_rate, staircase=False, name=None) ...

  3. 【TensorFlow】TensorFlow函数精讲之tf.train.exponential_decay()

    tf.train.exponential_decay实现指数衰减率.通过这个函数,可以先使用较大的学习率来快速得到一个比较优的解,然后随着迭代的继续逐步减小学习率,使得模型在训练后期更加稳定. tf. ...

  4. TensorFlow基础篇(一)——tf.train.exponential_decay()

    tf.train.exponential_decay实现指数衰减率.通过这个函数,可以先使用较大的学习率来快速得到一个比较优的解,然后随着迭代的继续逐步减小学习率,使得模型在训练后期更加稳定. tf. ...

  5. TensorFlow 中的 tf.train.exponential_decay() 指数衰减法

    exponential_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None) 使 ...

  6. tf.train.Example的用法(转)

    前言 最近在看到一个代码时,里面用到了tf.train.Example,于是学习了其用法,这里记录一下,也希望能对其他朋友有用. 另外,本文涉及的代码基于python 3.6.5 tensorflow ...

  7. tf.train.Example的用法

    目录 前言 tf.train.BytesList等 tf.train.Feature tf.train.Features tf.train.Example 前言 最近在看到一个代码时,里面用到了tf. ...

  8. TensorFlow 实战(二)—— tf.train(优化算法)

    Training | TensorFlow tf 下以大写字母开头的含义为名词的一般表示一个类(class) 1. 优化器(optimizer) 优化器的基类(Optimizer base class ...

  9. tensorflow || 滑动平均的理解--tf.train.ExponentialMovingAverage

    1 滑动平均的理解 滑动平均(exponential moving average),或者叫做指数加权平均(exponentially weighted moving average),可以用来估计变 ...

最新文章

  1. 用英语优雅地表达愤怒
  2. 编译与部署dubbo管控平台dubbo-admin
  3. 9.5 程序示例--推荐系统-机器学习笔记-斯坦福吴恩达教授
  4. Visual studio内存泄露检查工具--BoundsChecker
  5. 图像处理基本算法-滤波
  6. 构建高性能.NET应用之配置高可用IIS服务器-第二篇 IIS请求处理模型
  7. MySQL 增加、更新、删除
  8. php时间测试,PHP 测试程序运行时间
  9. leetcode 225. Implement Stack using Queuesk
  10. 作业6 陪集 拉格朗日定理
  11. 亚马逊不再是以前了--亚马逊防关联
  12. 数据科学库(六)pandas中的时间序列
  13. 优麒麟 20.04 LTS Pro安装Canon LBP2900打印机
  14. 2021年化工自动化控制仪表新版试题及化工自动化控制仪表找解析
  15. 供应博思特posital增量型编码器
  16. 微信小程序background-img问题
  17. 大脑的四个黄金记忆时间段
  18. 优秀的JavaScript模块是怎样炼成的
  19. com.googlecode.genericdao
  20. JavaScript——JSON

热门文章

  1. 【云原生】设备云之FlexManager边缘计算[Javascript]
  2. Delphi2007来了
  3. tlias 教学过程_构建科学的“教学评价体系”,传智专修学院拉近教师与学生的距离...
  4. Zend Studio中安装Aptana及几个配置说明
  5. H5/APP客服端源码/uniapp在线客服系统源码开源了,全源码代码解读及发行安装教程...
  6. Vs —— 转移Qt项目后环境问题
  7. 5.8G传输设备替代方案(解决5.8G设备的抗干扰问题)5.8G点对点 点对多点无线网络
  8. 单片机原理与应用-51
  9. Matlab二维图形绘制与图形处理
  10. 什么是 ETL ?什么是 ELT ?