Skip to content

Commit

Permalink
Fixes Inconsistent weight assignment operations in DQNPolicyGraph (#4… (
Browse files Browse the repository at this point in the history
#4504)

* Fixes Inconsistent weight assignment operations in DQNPolicyGraph (#4502)

* Update dqn_policy_graph.py
  • Loading branch information
vuoristo authored and ericl committed Mar 29, 2019
1 parent f4b313e commit 798944f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/ray/rllib/agents/dqn/dqn_policy_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ def __init__(self, observation_space, action_space, config):
# update_target_fn will be called periodically to copy Q network to
# target Q network
update_target_expr = []
for var, var_target in zip(
sorted(self.q_func_vars, key=lambda v: v.name),
sorted(self.target_q_func_vars, key=lambda v: v.name)):
assert len(self.q_func_vars) == len(self.target_q_func_vars), \
(self.q_func_vars, self.target_q_func_vars)
for var, var_target in zip(self.q_func_vars, self.target_q_func_vars):
update_target_expr.append(var_target.assign(var))
self.update_target_expr = tf.group(*update_target_expr)

Expand Down

0 comments on commit 798944f

Please sign in to comment.