Skip to content

Instantly share code, notes, and snippets.

@rayheberer
Created August 10, 2018 03:58
Show Gist options
  • Save rayheberer/a8975ad8a6d579b07f64e0c3d1129311 to your computer and use it in GitHub Desktop.
Save rayheberer/a8975ad8a6d579b07f64e0c3d1129311 to your computer and use it in GitHub Desktop.
class DQNMoveOnly(base_agent.BaseAgent):
# ...
# ...
# ...
# ...
def _update_target_network(self):
online_vars = tf.get_collection(
tf.GraphKeys.TRAINABLE_VARIABLES, 'DQN')
target_vars = tf.get_collection(
tf.GraphKeys.TRAINABLE_VARIABLES, 'DQNTarget')
update_op = []
for online_var, target_var in zip(online_vars, target_vars):
update_op.append(target_var.assign(online_var))
self.sess.run(update_op)
# ...
# ...
# ...
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment