code: def build_trainer(
      self,
      normalization_data_map: Dict[str, NormalizationData],
      use_gpu: bool,
      reward_options: Optional[RewardOptions] = None,
  ) -> DQNTrainer:
      net_builder = self.net_builder.value
      q_network = net_builder.build_q_network(
          self.state_feature_config,
          normalization_data_map[NormalizationKey.STATE],
          len(self.action_names),
      )
  
      q_network_target = q_network.get_target_network()
  
      reward_options = reward_options or RewardOptions()
      metrics_to_score = get_metrics_to_score(
          reward_options.metric_reward_values
      )
  
      reward_network, q_network_cpe, q_network_cpe_target = (
          None,
          None,
          None,
      )
      if self.eval_parameters.calc_cpe_in_training:
          # Metrics + reward
          num_output_nodes = (len(metrics_to_score) + 1) * len(
              # pyre-fixme[16]: `DQNTrainerParameters` has no attribute `actions`.
              self.trainer_param.actions
          )
  
          cpe_net_builder = self.cpe_net_builder.value
          reward_network = cpe_net_builder.build_q_network(
              self.state_feature_config,
              normalization_data_map[NormalizationKey.STATE],
              num_output_nodes,
          )
          q_network_cpe = cpe_net_builder.build_q_network(
              self.state_feature_config,
              normalization_data_map[NormalizationKey.STATE],
              num_output_nodes,
          )
  
          q_network_cpe_target = q_network_cpe.get_target_network()
  
      trainer = DQNTrainer(
          q_network=q_network,
          q_network_target=q_network_target,
          reward_network=reward_network,
          q_network_cpe=q_network_cpe,
          q_network_cpe_target=q_network_cpe_target,
          metrics_to_score=metrics_to_score,
          evaluation=self.eval_parameters,
          # pyre-fixme[16]: `DQNTrainerParameters` has no attribute `asdict`.
          **self.trainer_param.asdict(),
      )
      return trainer
  
imports: import logging
  from typing import Dict, Optional
  import torch
  from reagent.core.dataclasses import dataclass, field
  from reagent.core.parameters import NormalizationData, NormalizationKey, param_hash
  from reagent.evaluation.evaluator import get_metrics_to_score
  from reagent.model_managers.discrete_dqn_base import DiscreteDQNBase
  from reagent.net_builder.discrete_dqn.dueling import Dueling
  from reagent.net_builder.discrete_dqn.fully_connected import FullyConnected
  from reagent.net_builder.unions import DiscreteDQNNetBuilder__Union
  from reagent.prediction.cfeval.predictor_wrapper import BanditRewardNetPredictorWrapper
  from reagent.reporting.discrete_dqn_reporter import DiscreteDQNReporter
  from reagent.training import DQNTrainer, DQNTrainerParameters, ReAgentLightningModule
  from reagent.training.dqn_trainer_base import DQNTrainerBaseLightning
  from reagent.workflow.types import RewardOptions
label_desc: Use image node_id 4 for calling the DiscreteDQN obj's underlying member method code with example usage: obj.build_trainer(normalization_data_map, use_gpu, reward_options) and returns: trainer