Skip to content

Instantly share code, notes, and snippets.

@AurelianTactics
Last active January 9, 2019 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AurelianTactics/fd2325bc1f8f325e7afb26701cf775ef to your computer and use it in GitHub Desktop.
Save AurelianTactics/fd2325bc1f8f325e7afb26701cf775ef to your computer and use it in GitHub Desktop.
TRFL Target Network Updating: update_target_network_tau1.py
#in graph
#TRFL way
target_network_update_ops = trfl.update_target_variables(targetQN.get_qnetwork_variables(),mainQN.get_qnetwork_variables(),tau=1.0)
#in session
with tf.Session() as sess:
#...
for ep in range(1, train_episodes):
#...
#update target q network
if step % update_target_every == 0:
#TRFL way
sess.run(target_network_update_ops)
#TensorFlow way
#copy_model_parameters(sess, mainQN, targetQN)
print("\nCopied model parameters to target network.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment