# learning rate decay

```decayed_learning_rate = learning_rate *
decay_rate ^ (global_step / decay_steps)```

```import tensorflow as tf

global_step = tf.Variable(0, trainable=False)

initial_learning_rate = 0.1 #初始学习率

learning_rate = tf.train.exponential_decay(initial_learning_rate,
global_step=global_step,
decay_steps=10,decay_rate=0.9)

with tf.Session() as sess:
tf.global_variables_initializer().run()
print(sess.run(learning_rate))
for i in range(10):
_, rate = sess.run([add_global, learning_rate])
print(rate)```

```import tensorflow as tf

global_step = tf.Variable(0, trainable=False)

initial_learning_rate = 0.1 #初始学习率

learning_rate = tf.train.exponential_decay(initial_learning_rate,
global_step=global_step,
decay_steps=10,decay_rate=0.9)

train_op = opt.minimise(loss)

with tf.Session() as sess:
tf.global_variables_initializer().run()
print(sess.run(learning_rate))
for i in range(10):
_= sess.run(train_op)
print(rate)```

## 参考资料

https://www.tensorflow.org/api_docs/python/tf/train/exponential_decay

87 篇文章30 人订阅

0 条评论

## 相关文章

2442

2717

2886

### 从零开始用Python构造决策树（附公式、代码）

? 来源：Python中文社区 作者：weapon 本文长度为700字，建议阅读5分钟 本文介绍如何不利用第三方库，仅用python自带的标准库来构造一个决策...

3208

2384

2663

### Caffe学习笔记(七)：使用训练好的model做预测(mnist)

Python版本： Python2.7 运行平台： Ubuntu14.04 一、前言     在之前的笔记中，已经生成了训练好的mnist.cafffemod...

4445

5266