code: def __init__(self, config):
      self.config = config
      self.sample_data_queue = queue.Queue(
          maxsize=config["sample_queue_max_size"]
      )
  
      # =========== Create Agent ==========
      env = gym.make(config["env_name"])
      env = wrap_deepmind(env, dim=config["env_dim"], obs_format="NCHW")
      obs_shape = env.observation_space.shape
  
      act_dim = env.action_space.n
  
      model = AtariModel(act_dim)
      algorithm = parl.algorithms.IMPALA(
          model,
          sample_batch_steps=self.config["sample_batch_steps"],
          gamma=self.config["gamma"],
          vf_loss_coeff=self.config["vf_loss_coeff"],
          clip_rho_threshold=self.config["clip_rho_threshold"],
          clip_pg_rho_threshold=self.config["clip_pg_rho_threshold"],
      )
      self.agent = AtariAgent(algorithm)
  
      self.cache_params = self.agent.get_weights()
      self.params_lock = threading.Lock()
      self.params_updated = False
      self.cache_params_sent_cnt = 0
      self.total_params_sync = 0
  
      # ========== Learner ==========
      self.lr, self.entropy_coeff = None, None
      self.lr_scheduler = PiecewiseScheduler(config["lr_scheduler"])
      self.entropy_coeff_scheduler = PiecewiseScheduler(
          config["entropy_coeff_scheduler"]
      )
  
      self.total_loss_stat = WindowStat(100)
      self.pi_loss_stat = WindowStat(100)
      self.vf_loss_stat = WindowStat(100)
      self.entropy_stat = WindowStat(100)
      self.kl_stat = WindowStat(100)
      self.learn_time_stat = TimeStat(100)
      self.start_time = None
  
      self.learn_thread = threading.Thread(target=self.run_learn)
      self.learn_thread.setDaemon(True)
      self.learn_thread.start()
  
      # ========== Remote Actor ===========
      self.remote_count = 0
  
      self.batch_buffer = []
      self.remote_metrics_queue = queue.Queue()
      self.sample_total_steps = 0
  
      self.create_actors()
  
imports: import gym
  import numpy
  import os
  from six.moves import queue
  import time
  import threading
  import parl
  import paddle
  from atari_model import AtariModel
  from atari_agent import AtariAgent
  from parl.env.atari_wrappers import wrap_deepmind
  from parl.utils import logger, summary
  from parl.utils.scheduler import PiecewiseScheduler
  from parl.utils.time_stat import TimeStat
  from parl.utils.window_stat import WindowStat
  from actor import Actor
label_desc: Use image node_id 1 to create a new Learner object from inherited base classes: object with example: obj = Learner(config)