Skip to content

DQNLearnerMetricsLogger ​

python
DQNLearnerMetricsLogger(metrics: MetricsTracker, action_names: list[str] | None, categorical_enabled: bool) -> None

Logs DQN learner metrics on this Learner's own iterations % 10 cadence.

Initialize the metrics logger.

Parameters:

  • metrics (MetricsTracker) – Metrics tracker used for output.
  • action_names (list[str] | None) – Action names for per-action Q-value logging, or None.
  • categorical_enabled (bool) – Whether categorical (C51) DQN is enabled.

Source

Methods ​

log_metrics ​

python
log_metrics(iterations: int, lr: float, loss: float, weighted_loss: torch.Tensor, q_values: torch.Tensor, grad_norm: float, batch: LearnerBatch, total_skipped_updates: int) -> None

Log learner metrics for the current optimization step.

Parameters:

  • iterations (int) – The current learner iteration count.
  • lr (float) – The current learning rate.
  • loss (float) – The raw loss value.
  • weighted_loss (Tensor) – The weighted loss tensor (for PER).
  • q_values (Tensor) – The Q-values tensor.
  • grad_norm (float) – The gradient norm.
  • batch (LearnerBatch) – The sampled learner batch for this step.
  • total_skipped_updates (int) – Total number of skipped PER priority updates.

Source