mirror of
https://github.com/wassname/DeepRL.git
synced 2026-09-09 11:13:47 +08:00
Reseed for each worker
This commit is contained in:
@@ -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 = []
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user