From fed4bd51637fbb98d4a5ff2650d5684339d94082 Mon Sep 17 00:00:00 2001 From: Shangtong Zhang Date: Tue, 12 Dec 2017 10:39:16 -0700 Subject: [PATCH] Update async methods --- README.md | 10 +++++++++- main.py | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0ecf61a..e577cc8 100644 --- a/README.md +++ b/README.md @@ -90,12 +90,20 @@ I use 8 threads and a two tanh hidden layer network, each hidden layer has 64 hi # Usage Detailed usage and all training parameters can be found in ```main.py```. -And you need to create following directories before running the program: + +You need to create following directories before running the program: ``` cd DeepRL mkdir data log ``` +Code is only tested in macOS 10.12 and CentO/S 6.8. And for CentO/S 6.8, you need +``` +export OMP_NUM_THREADS=1 +``` +manually in shell before running parallelized implementation. + + # References * [Human Level Control through Deep Reinforcement Learning](https://www.nature.com/nature/journal/v518/n7540/full/nature14236.html) * [Asynchronous Methods for Deep Reinforcement Learning](https://arxiv.org/abs/1602.01783) diff --git a/main.py b/main.py index 2203e46..26ff0f2 100644 --- a/main.py +++ b/main.py @@ -100,7 +100,7 @@ def async_pixel_atari(name): config.discount = 0.99 config.target_network_update_freq = 10000 config.max_episode_length = 10000 - config.num_workers = 10 + config.num_workers = 6 config.update_interval = 20 config.test_interval = 50000 config.test_repetitions = 1 @@ -120,7 +120,7 @@ def a3c_pixel_atari(name): config.worker = AdvantageActorCritic config.discount = 0.99 config.max_episode_length = 10000 - config.num_workers = 10 + config.num_workers = 6 config.update_interval = 20 config.test_interval = 50000 config.test_repetitions = 1 @@ -270,7 +270,7 @@ if __name__ == '__main__': # gym.logger.setLevel(logging.DEBUG) gym.logger.setLevel(logging.INFO) - dqn_cart_pole() + # dqn_cart_pole() # async_cart_pole() # a3c_cart_pole() # a3c_continuous() @@ -282,7 +282,7 @@ if __name__ == '__main__': # dqn_pixel_atari('PongNoFrameskip-v4') # async_pixel_atari('PongNoFrameskip-v4') - # a3c_pixel_atari('PongNoFrameskip-v4') + a3c_pixel_atari('PongNoFrameskip-v4') # dqn_pixel_atari('BreakoutNoFrameskip-v4') # async_pixel_atari('BreakoutNoFrameskip-v4')