class_docstr: A trainer for the DQN algorithm and its variants.
  
  Configures optimizers, builds the losses and train functions for the
  Q-learning based algorithm variants. Supports MaxQ and SARSA style
  TD-learning under both, standard and batch-constrained q-learning.
  During training, updates CPE metrics estimators.
  
  Attributes:
      double_q_learning: a boolean flag whether to use double-q learning.
      minibatch_size: an int number of samples per minibatch.
      minibatches_per_step: an int number of minibatch updates per step.
      q_network: a network object mapping states to q-values of all actions.
      q_network_target: a copy of q-network for training stability used in
          estimating q-values targets.
      q_network_optimizer: an optimizer object for training q-network.
      bcq: a config file for batch-constrained q-learning (BCQ).
      bcq_imitator: if using batch-constrained q-learning, the behavior
          policy used for BCQ training.
      all_action_scores: a torch tensor containing q-network
              predictions from the current states.
docstr: Logs training update results.
docstr_tok: ["Logs","training","update","results","."]
code: def _log_dqn(
      self,
      td_loss,
      logged_action_idxs,
      training_batch,
      rewards,
      model_action_idxs,
  ):
      """Logs training update results."""
      self.reporter.log(
          td_loss=td_loss,
          logged_actions=logged_action_idxs,
          logged_propensities=training_batch.extras.action_probability,
          logged_rewards=rewards,
          logged_values=None,  # Compute at end of each epoch for CPE
          model_values=self.all_action_scores,
          model_values_on_logged_actions=None,  # Compute at end of each epoch for CPE
          model_action_idxs=model_action_idxs,
      )
      model_values = self._dense_to_action_dict(
          self.all_action_scores.mean(dim=0)
      )
      action_histogram = self._dense_to_action_dict(
          training_batch.action.float().mean(dim=0)
      )
      if training_batch.extras.action_probability is None:
          logged_propensities = None
      else:
          logged_propensities = (
              training_batch.extras.action_probability.mean(dim=0)
          )
      model_action_idxs = self._dense_to_action_dict(
          torch.nn.functional.one_hot(
              model_action_idxs.squeeze(1), num_classes=self.num_actions
          )
          .float()
          .mean(dim=0)
      )
      # log metrics if a logger is set
      if self.logger:
          self.logger.log_metrics(
              {
                  "td_loss": td_loss,
                  "logged_actions": action_histogram,
                  "logged_propensities": logged_propensities,
                  "logged_rewards": rewards.mean(),
                  "model_values": model_values,
                  "model_action_idxs": model_action_idxs,
              },
              step=self.all_batches_processed,
          )
  
imports: import logging
  from typing import List, Optional, Tuple
  import reagent.core.types
  import torch
  from reagent.core.configuration import resolve_defaults
  from reagent.core.dataclasses import dataclass, field
  from reagent.core.parameters import EvaluationParameters, RLParameters
  from reagent.optimizer import Optimizer__Union, SoftUpdate
  from reagent.training.dqn_trainer_base import DQNTrainerBaseLightning
  from reagent.training.imitator_training import get_valid_actions_from_imitator
label_desc: Use image node_id 7 for calling the DQNTrainer obj's underlying member method code with example usage: obj._log_dqn(td_loss, logged_action_idxs, training_batch, rewards, model_action_idxs) without return types