Last active
January 9, 2019 17:58
-
-
Save AurelianTactics/fd2325bc1f8f325e7afb26701cf775ef to your computer and use it in GitHub Desktop.
TRFL Target Network Updating: update_target_network_tau1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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