【发布时间】:2017-05-03 17:32:50
【问题描述】:
我们为什么要使用 tf.variable_scope:
我知道它的东西链接创建实例的基本思想。但是在下面的代码和许多其他代码中,使用 tf.get_variable 无法在任何地方检索范围。那么范围的作用是什么?不使用会怎样?
with tf.variable_scope("placeholder"):
input = tf.placeholder(tf.float32, shape=[None, 1024])
y_true = tf.placeholder(tf.int32, shape=[None, 1])
with tf.variable_scope('FullyConnected'):
w = tf.get_variable('w', shape=[1024, 1024],
initializer=tf.random_normal_initializer(stddev=1e-1))
b = tf.get_variable('b', shape=[1024],
initializer=tf.constant_initializer(0.1))
z = tf.matmul(input, w) + b
y = tf.nn.relu(z)
我看不到以后任何地方都在使用范围。它服务于什么目的。 我想知道如果我删除它会发生什么
【问题讨论】:
标签: variables scope tensorflow