您的位置:首页 > 编程语言 > Python开发

深度学习中遇到的Python问题(三)

2018-03-28 14:45 295 查看
1.tf.train.piecewise_constant

走到一定步长更改学习率。

initial_learning_rate = 0.1 * params['batch_size'] / 128
batches_per_epoch = _NUM_IMAGES['train'] / params['batch_size']

global_step = tf.train.get_or_create_global_step()

boundaries = [int(batches_per_epoch * epoch) for epoch in [100, 150, 200]]
values = [initial_learning_rate * decay for decay in [1, 0.1, 0.01, 0.001]]
learning_rate = tf.train.piecewise_constant(
tf.cast(global_step, tf.int32), boundaries, values)


2.tf.identity

https://blog.csdn.net/hu_guan_jie/article/details/78495297

没看懂。

tf.identity是返回了一个一模一样新的tensor,再control_dependencies的作用块下,需要增加一个新节点到gragh中。

3.tf.summary.scalar

对标量数据汇总和记录

一些高级的API

https://zhuanlan.zhihu.com/p/29073452
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: