Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a minor issue replay.py #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deep_rl/component/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ class ReplayWrapper(mp.Process):
EXIT = 2
UPDATE_PRIORITIES = 3

def __init__(self, replay_cls, replay_kwargs, async=True):
def __init__(self, replay_cls, replay_kwargs, async_flag=True):
mp.Process.__init__(self)
self.replay_kwargs = replay_kwargs
self.replay_cls = replay_cls
self.cache_len = 2
if async:
if async_flag:
self.pipe, self.worker_pipe = mp.Pipe()
self.start()
else:
Expand Down
8 changes: 4 additions & 4 deletions examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def quantile_regression_dqn_feature(**kwargs):
replay_kwargs = dict(
memory_size=int(1e4),
batch_size=config.batch_size)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs, async=True)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs)

config.random_action_prob = LinearSchedule(1.0, 0.1, 1e4)
config.discount = 0.99
Expand Down Expand Up @@ -146,7 +146,7 @@ def quantile_regression_dqn_pixel(**kwargs):
batch_size=config.batch_size,
history_length=4,
)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs, async=True)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs)

config.state_normalizer = ImageNormalizer()
config.reward_normalizer = SignNormalizer()
Expand Down Expand Up @@ -177,7 +177,7 @@ def categorical_dqn_feature(**kwargs):
replay_kwargs = dict(
memory_size=int(1e4),
batch_size=config.batch_size)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs, async=True)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs)

config.discount = 0.99
config.target_network_update_freq = 200
Expand Down Expand Up @@ -211,7 +211,7 @@ def categorical_dqn_pixel(**kwargs):
batch_size=config.batch_size,
history_length=4,
)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs, async=True)
config.replay_fn = lambda: ReplayWrapper(UniformReplay, replay_kwargs)

config.discount = 0.99
config.state_normalizer = ImageNormalizer()
Expand Down