From 2409c61cf9f3e8af47e51091eaa531b2123ac9fb Mon Sep 17 00:00:00 2001 From: zenghsh3 Date: Fri, 28 Dec 2018 13:04:27 +0800 Subject: [PATCH] refine code --- fluid/DeepQNetwork/DQN_agent.py | 1 - fluid/DeepQNetwork/DoubleDQN_agent.py | 1 - fluid/DeepQNetwork/DuelingDQN_agent.py | 1 - 3 files changed, 3 deletions(-) diff --git a/fluid/DeepQNetwork/DQN_agent.py b/fluid/DeepQNetwork/DQN_agent.py index b60a3193..07f90225 100644 --- a/fluid/DeepQNetwork/DQN_agent.py +++ b/fluid/DeepQNetwork/DQN_agent.py @@ -79,7 +79,6 @@ class DQNModel(object): policy_vars.sort(key=lambda x: x.name) target_vars.sort(key=lambda x: x.name) - self._sync_program = fluid.Program() with fluid.program_guard(self._sync_program): sync_ops = [] for i, var in enumerate(policy_vars): diff --git a/fluid/DeepQNetwork/DoubleDQN_agent.py b/fluid/DeepQNetwork/DoubleDQN_agent.py index 5beebffe..6d15c6b5 100644 --- a/fluid/DeepQNetwork/DoubleDQN_agent.py +++ b/fluid/DeepQNetwork/DoubleDQN_agent.py @@ -86,7 +86,6 @@ class DoubleDQNModel(object): policy_vars.sort(key=lambda x: x.name) target_vars.sort(key=lambda x: x.name) - self._sync_program = fluid.Program() with fluid.program_guard(self._sync_program): sync_ops = [] for i, var in enumerate(policy_vars): diff --git a/fluid/DeepQNetwork/DuelingDQN_agent.py b/fluid/DeepQNetwork/DuelingDQN_agent.py index 58ac9e61..bf165f76 100644 --- a/fluid/DeepQNetwork/DuelingDQN_agent.py +++ b/fluid/DeepQNetwork/DuelingDQN_agent.py @@ -79,7 +79,6 @@ class DuelingDQNModel(object): policy_vars.sort(key=lambda x: x.name) target_vars.sort(key=lambda x: x.name) - self._sync_program = fluid.Program() with fluid.program_guard(self._sync_program): sync_ops = [] for i, var in enumerate(policy_vars): -- GitLab