code: def __init__(
      self,
      agent_parameters,
      parent: Union["LevelManager", "CompositeAgent"] = None,
  ):
      super().__init__(agent_parameters, parent)
  
      if isinstance(
          self.ap.algorithm.action_drop_method_parameters, KNNParameters
      ):
          self.knn_trees = (
              []
          )  # will be filled out later, as we don't have the action space size yet
          self.average_dist = 0
  
          def to_embedding(states: Union[List[StateType], Dict]):
              if isinstance(states, list):
                  states = self.prepare_batch_for_inference(
                      states, "reward_model"
                  )
              if (
                  self.ap.algorithm.action_drop_method_parameters.use_state_embedding_instead_of_state
              ):
                  return self.networks[
                      "reward_model"
                  ].online_network.predict(
                      states,
                      outputs=[
                          self.networks[
                              "reward_model"
                          ].online_network.state_embedding[0]
                      ],
                  )
              else:
                  return states["observation"]
  
          self.embedding = to_embedding
  
      elif isinstance(
          self.ap.algorithm.action_drop_method_parameters,
          NNImitationModelParameters,
      ):
          if "imitation_model" not in self.ap.network_wrappers:
              # user hasn't defined params for the reward model. we will use the same params as used for the 'main'
              # network.
              self.ap.network_wrappers["imitation_model"] = deepcopy(
                  self.ap.network_wrappers["reward_model"]
              )
      else:
          raise ValueError(
              "Unsupported action drop method {} for DDQNBCQAgent".format(
                  type(self.ap.algorithm.action_drop_method_parameters)
              )
          )
  
imports: from collections import OrderedDict
  from copy import deepcopy
  from typing import Union, List, Dict
  import numpy
  from rl_coach.agents.dqn_agent import DQNAgentParameters, DQNAlgorithmParameters, DQNAgent
  from rl_coach.base_parameters import Parameters
  from rl_coach.core_types import EnvironmentSteps, Batch, StateType
  from rl_coach.graph_managers.batch_rl_graph_manager import BatchRLGraphManager
  from rl_coach.logger import screen
  from rl_coach.memories.non_episodic.differentiable_neural_dictionary import AnnoyDictionary
  from rl_coach.schedules import LinearSchedule
label_desc: Use image node_id 1 to create a new DDQNBCQAgent object from inherited base classes: DQNAgent with example: obj = DDQNBCQAgent(agent_parameters, parent)