diff --git a/agent/async_agent.py b/agent/async_agent.py index b5e50d7..7dc26b0 100644 --- a/agent/async_agent.py +++ b/agent/async_agent.py @@ -13,8 +13,11 @@ from async_worker import * import pickle import os import time +import sys def train(id, config, learning_network, extra): + np.random.seed() + torch.manual_seed(np.random.randint(sys.maxsize)) worker = config.worker(config, learning_network, extra) episode = 0 rewards = [] @@ -27,6 +30,8 @@ def train(id, config, learning_network, extra): episode += 1 def evaluate(config, task, learning_network, extra): + np.random.seed() + torch.manual_seed(np.random.randint(sys.maxsize)) test_rewards = [] test_points = [] test_wall_times = [] diff --git a/main.py b/main.py index 26ba78c..c9d0d8f 100644 --- a/main.py +++ b/main.py @@ -283,7 +283,7 @@ if __name__ == '__main__': # dqn_cart_pole() # async_cart_pole() - # a3c_cart_pole() + a3c_cart_pole() # a3c_continuous() # p3o_continuous() # d3pg_continuous() @@ -291,7 +291,7 @@ if __name__ == '__main__': # dqn_fruit() # hrdqn_fruit() - dqn_pixel_atari('PongNoFrameskip-v4') + # dqn_pixel_atari('PongNoFrameskip-v4') # async_pixel_atari('PongNoFrameskip-v4') # a3c_pixel_atari('PongNoFrameskip-v4')