Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Copies one set of variables to another.
# Used to set worker network parameters to those of global network.
def update_target_graph(from_scope,to_scope):
from_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, from_scope)
to_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, to_scope)
op_holder = []
for from_var,to_var in zip(from_vars,to_vars):
return op_holder
class Worker():
def __init__(self,game,name,s_size,a_size,trainer,saver,model_path):
#Create the local copy of the network and the tensorflow op to copy global paramters to local network
self.local_AC = AC_Network(s_size,a_size,,trainer)
self.update_local_ops = update_target_graph('global',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment