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: Runs model evaluation on an input batch of data.
  
  Args:
      batch: a batch data object, e.g. DiscreteDqnInput object.
      batch_idx: an integer batch index.
  
  Returns:
      An EvaluationDataPage object with evaluation results.
docstr_tok: ["Runs","model","evaluation","on","an","input","batch","of","data",".","Args",":","batch",":","a","batch","data","object",",","e.g",".","DiscreteDqnInput","object",".","batch_idx",":","an","integer","batch","index",".","Returns",":","An","EvaluationDataPage","object","with","evaluation","results","."]
code: def validation_step(self, batch, batch_idx):
      """Runs model evaluation on an input batch of data.
  
      Args:
          batch: a batch data object, e.g. DiscreteDqnInput object.
          batch_idx: an integer batch index.
  
      Returns:
          An EvaluationDataPage object with evaluation results.
      """
      if isinstance(batch, dict):
          batch = rlt.DiscreteDqnInput.from_dict(batch)
      rewards = self.boost_rewards(batch.reward, batch.action)
      discount_tensor = self.compute_discount_tensor(batch, rewards)
      td_loss = self.compute_td_loss(batch, rewards, discount_tensor)
      # Show eval_td_loss in a tensorboard graph
      self.log("eval_td_loss", td_loss, batch_size=batch.batch_size())
      return super().validation_step(batch, batch_idx)
  
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 9 for calling the DQNTrainer obj's underlying member method code with example usage: obj.validation_step(batch, batch_idx) and returns: super