diff --git a/README.md b/README.md index f1e9cf3..4f20b6e 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,12 @@ Implemented algorithms: * Deep Q-Learning (DQN) * Double DQN * Dueling DQN -* Async Advantage Actor Critic (A3C) +* (Async) Advantage Actor Critic (A3C / A2C) * Async One-Step Q-Learning * Async One-Step Sarsa * Async N-Step Q-Learning * Continuous A3C * Distributed Deep Deterministic Policy Gradient (Distributed DDPG, aka D3PG) -* Hybrid Reward Architecture (HRA) * Parallelized Proximal Policy Optimization (P3O, similar to DPPO) * Action Conditional Video Prediction diff --git a/agent/A2C_agent.py b/agent/A2C_agent.py index 1d7509f..4b7aa6d 100644 --- a/agent/A2C_agent.py +++ b/agent/A2C_agent.py @@ -100,7 +100,7 @@ class A2CAgent: value_loss = 0.5 * (Variable(returns) - value).pow(2) self.optimizer.zero_grad() - (policy_loss + value_loss).mean().backward() + (policy_loss + value_loss).sum().backward() nn.utils.clip_grad_norm(self.network.parameters(), config.gradient_clip) self.optimizer.step() diff --git a/main.py b/main.py index e15ac5b..8aa9b89 100644 --- a/main.py +++ b/main.py @@ -308,13 +308,14 @@ if __name__ == '__main__': mkdir('data/video') mkdir('log') os.system('export OMP_NUM_THREADS=1') + os.system('export CUDA_VISIBLE_DEVICES=0') # logger.setLevel(logging.DEBUG) logger.setLevel(logging.INFO) - dqn_cart_pole() + # dqn_cart_pole() # async_cart_pole() # a3c_cart_pole() - # a2c_cart_pole() + a2c_cart_pole() # a3c_continuous() # p3o_continuous() # d3pg_continuous()