I have a predefined code that creates a Tensorflow graph. The variables are contained in variable scopes and each has a predefined initializer. Is there any way to change the initializer of the variables?
example: The first graph defines
with tf.variable_scope('conv1')
w = tf.get_variable('weights')
Later on I would like to modify variable and change the initializer to Xavier:
with tf.variable_scope('conv1')
tf.get_variable_scope().reuse_variable()
w = tf.get_variable('weights',initializer=tf.contrib.layers.xavier_initializer(uniform=False))
However, when I reuse a variable, the initializer doesn't change.
later on when I do initialize_all_variables()
I get the default values and not Xavier
How can I change the initializer of a variable?
Thanks