code: def get_config(model):
      global args
      expreplay = ExpReplay(
          predictor_io_names=(["state"], ["Qvalue"]),
          get_player=lambda: get_player(train=True),
          num_parallel_players=NUM_PARALLEL_PLAYERS,
          state_shape=model.state_shape,
          batch_size=BATCH_SIZE,
          memory_size=MEMORY_SIZE,
          init_memory_size=INIT_MEMORY_SIZE,
          update_frequency=UPDATE_FREQ,
          history_len=FRAME_HISTORY,
          state_dtype=model.state_dtype.as_numpy_dtype,
      )
  
      # Set to other values if you need a different initial exploration
      # (e.g., # if you're resuming a training half-way)
      # expreplay.exploration = 1.0
  
      return TrainConfig(
          data=QueueInput(expreplay),
          model=model,
          callbacks=[
              ModelSaver(),
              PeriodicTrigger(
                  RunOp(DQNModel.update_target_param, verbose=True),
                  every_k_steps=5000,
              ),  # update target network every 5k steps
              expreplay,
              ScheduledHyperParamSetter(
                  "learning_rate", [(0, 1e-3), (60, 5e-4), (400, 1e-4)]
              ),
              ScheduledHyperParamSetter(
                  ObjAttrParam(expreplay, "exploration"),
                  [
                      (0, 1),
                      (10, 0.1),
                      (400, 0.01),
                  ],  # 1->0.1 in the first million steps
                  interp="linear",
              ),
              PeriodicTrigger(
                  Evaluator(
                      args.num_eval, ["state"], ["Qvalue"], get_player
                  ),
                  every_k_epochs=5
                  if "pong" in args.env.lower()
                  else 10,
              ),  # eval more frequently for easy games
          ],
          steps_per_epoch=STEPS_PER_EPOCH,
          max_epoch=500,  # a total of 50M state transition
      )
  
file_path: tensorpack/examples/DeepQNetwork/DQN.py
imports: import argparse
  import numpy
  import os
  import cv2
  import gym
  import tensorflow
  from tensorpack import *
  from atari_wrapper import FireResetEnv, FrameStack, LimitLength, MapState
  from common import Evaluator, eval_model_multithread, play_n_episodes
  from DQNModel import Model
  from expreplay import ExpReplay
label_desc: Use image node_id 3 for calling a global function with example usage: get_config(model) and returns: TrainConfig