为什么我们使用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)
我没有看到随后在任何地方使用的范围。它的服务目的是什么。 我想知道如果我删除它会发生什么
这有利于阅读:http://stackoverflow.com/q/35919020/1090562 –