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 bug in batch_recurrent_experiences regarding next_action #528

Merged
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: 3 additions & 1 deletion chainerrl/replay_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ def batch_recurrent_experiences(
'next_recurrent_state': model.concatenate_recurrent_states(
[ep[0]['next_recurrent_state'] for ep in experiences]),
}
if all(elem[-1]['next_action'] is not None for elem in experiences):
# Batch next actions only when all the transitions have them
if all(transition['next_action'] is not None
for transition in flat_transitions):
batch_exp['next_action'] = xp.asarray(
[transition['next_action'] for transition in flat_transitions])
return batch_exp
Expand Down