@EggGump
2018-09-06T15:43:37.000000Z
字数 465
阅读 833
tensorflow
from ctypes import *import tensorflow as tfimport matplotlib.pyplot as pltalpha = 0.1decay_rate = 0.96decay_step = 1000global_ = tf.Variable(tf.constant(0))global_step = 10000learn_rate = tf.train.exponential_decay(alpha,global_,decay_step,decay_rate,staircase=True)c = []with tf.Session() as sess:for i in range(global_step):tc = sess.run(learn_rate,feed_dict={global_:i})c.append(tc)plt.figure(1)plt.plot(range(global_step),c,'r-')plt.show()
