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

calculate scalar q_values to log average_q statistics in categorical dqn algorithms #32

Merged
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: 4 additions & 0 deletions pfrl/agents/categorical_dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ def _compute_y_and_t(self, exp_batch):
batch_q_target = self._compute_target_values(exp_batch)
assert batch_q_target.shape == (batch_size, n_atoms)

# for `agent.get_statistics()`
batch_q_scalars = qout.evaluate_actions(batch_actions)
self.q_record.extend(batch_q_scalars.detach().cpu().numpy().ravel())

return batch_q, batch_q_target

def _compute_loss(self, exp_batch, errors_out=None):
Expand Down