Reinforcement-learning-with-tensorflow
Reinforcement-learning-with-tensorflow copied to clipboard
question about tf.GraphKeys
"
with tf.variable_scope('eval_net'):
# c_names(collections_names) are the collections to store variables
c_names, n_l1, w_initializer, b_initializer =
['eval_net_params', tf.GraphKeys.GLOBAL_VARIABLES], 10,
tf.random_normal_initializer(0., 0.3), tf.constant_initializer(0.1) # config of layers
# first layer. collections is used later when assign to target net
with tf.variable_scope('l1'):
w1 = tf.get_variable('w1', [4, 10], initializer=w_initializer, collections=c_names)
b1 = tf.get_variable('b1', [1, 10], initializer=b_initializer, collections=c_names)
" In the above code, I quitely confused about the sentence "c_nams =['eval_net_params', tf.GraphKeys.GLOBAL_VARIABLES] ". What's the meaning of it? I think the type of "c_names" should be 'class' as it collect varibles, but it is list in the code. Why?