@EggGump
2018-09-06T23:43:37.000000Z
字数 465
阅读 681
tensorflow
from ctypes import *
import tensorflow as tf
import matplotlib.pyplot as plt
alpha = 0.1
decay_rate = 0.96
decay_step = 1000
global_ = tf.Variable(tf.constant(0))
global_step = 10000
learn_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()