tensorflow 中 name_scope和variable_scope
来源:互联网 发布:qq邮箱stmp服务器端口 编辑:程序博客网 时间:2024/06/05 15:48
import tensorflow as tfwith tf.name_scope("hello") as name_scope: arr1 = tf.get_variable("arr1", shape=[2,10],dtype=tf.float32) print (name_scope) print (arr1.name) print ("scope_name:%s " % tf.get_variable_scope().original_name_scope)
运行后的结果如下:
hello/
arr1:0
scope_name:
import tensorflow as tfwith tf.name_scope('hidden') as scope: a = tf.constant(5, name='alpha') W = tf.Variable(tf.random_uniform([1, 2], -1.0, 1.0), name='weights') b = tf.Variable(tf.zeros([1]), name='biases') print (a.name) print (W.name) print (b.name)运行的结果:
hidden/alpha:0
hidden/weights:0
hidden/biases:0
红色字体要强调的部分所以把字体改成了红色,理解name_scope 对 tf.get_variable()的作用和 tf.Variable()的不同
参考文献:http://blog.csdn.net/u012436149/article/details/53081454
0 0
- tensorflow 中 name_scope和variable_scope
- TensorFlow中,variable_scope和name_scope的不同之处
- tensorflow 中 name_scope 及 variable_scope 的异同
- tensorflow 中 variable_scope 与name_scope函数解析
- Tensorflow name_scope和variable_scope的区别
- TensorFlow:作用域name_scope和variable_scope
- tensorflow: name_scope 和 variable_scope的差别
- Tensorflow-variable_scope,name_scope
- tensorflow name_scope variable_scope
- tensorflow variable_scope\name_scope
- tensorflow name_scope && variable_scope
- tensorflow 中的 name_scope 与 variable_scope
- TensorFlow基础name_scope与variable_scope
- tensorflow:上下文管理器 与 name_scope, variable_scope
- tf.variable_scope和tf.name_scope的用法
- Tensorflow函数说明(4)—— variable_scope/name_scope
- tensorflow scope命名方法(variable_scope()与name_scope()解析)
- tensorflow variable_scope,tf.name_scope, tf.variable, tf.get_varible
- Cannot open channel to 5 at election address node5/192.168.1.204:3887
- AndroidStudio使用详细介绍
- Android-2048
- Mysql学习(三)
- ARP操作
- tensorflow 中 name_scope和variable_scope
- Socket通用TCP通信协议设计及实现(防止粘包,可移植,可靠)
- jQuery Easing 使用方法及其图解
- Android Studio 实用插件
- 项目练习—天天记账
- powerdesigner设计oracle数据库注意事项
- StrutsPrepareAndExecuteFilter 与 FilterDispatcher的区别
- java文件读写操作大全
- 叠罗汉II