I'm not sure if this is possible in Tensorflow and I'm concerned I may have to switch over to PyTorch.
Basically, I have this layer:
self.policy_conv1 = tf.layers.conv2d(inputs=self.policy_s, filters=16, kernel_size=(8,8),strides=(4,4), padding = 'valid',activation=tf.nn.relu, kernel_initializer=tf.glorot_uniform_initializer, bias_initializer = tf.glorot_uniform_initializer)
Which I'm trying to copy into another layer every 100 iterations of training or so:
self.eval_conv1 = tf.layers.conv2d(inputs=self.s, filters=16, kernel_size=(8,8),strides=(4,4), padding = 'valid', activation=tf.nn.relu, kernel_initializer=tf.glorot_uniform_initializer, bias_initializer = tf.glorot_uniform_initializer)
tf.assign doesn't seem to be the right tool, and the following doesn't seem to work:
self.policy_conv1 = tf.stop_gradient(tf.identity(self.eval_conv1))
Essentially, I am looking to copy over the eval conv layer into the policy conv layer, and not have them tied together each time the graph runs one variable or the other (which is occurring with the identity snippet above). If someone can point me to the needed code, I would appreciate it.