docstr: Determine if online weights should be copied to the target.
  
  :return: boolean: True if the online weights should be copied to the target.
docstr_tok: ["Determine","if","online","weights","should","be","copied","to","the","target",".",":","return",":","boolean",":","True","if","the","online","weights","should","be","copied","to","the","target","."]
code: def _should_update_online_weights_to_target(self):
      """
      Determine if online weights should be copied to the target.
  
      :return: boolean: True if the online weights should be copied to the target.
      """
  
      # update the target network of every network that has a target network
      step_method = (
          self.ap.algorithm.num_steps_between_copying_online_weights_to_target
      )
      if step_method.__class__ == TrainingSteps:
          should_update = (
              self.training_iteration
              - self.last_target_network_update_step
          ) >= step_method.num_steps
          if should_update:
              self.last_target_network_update_step = (
                  self.training_iteration
              )
      elif step_method.__class__ == EnvironmentSteps:
          should_update = (
              self.total_steps_counter
              - self.last_target_network_update_step
          ) >= step_method.num_steps
          if should_update:
              self.last_target_network_update_step = (
                  self.total_steps_counter
              )
      else:
          raise ValueError(
              "The num_steps_between_copying_online_weights_to_target parameter should be either "
              "EnvironmentSteps or TrainingSteps. Instead it is {}".format(
                  step_method.__class__
              )
          )
      return should_update
  
imports: import copy
  import random
  from collections import OrderedDict
  from typing import Dict, List, Union, Tuple
  import numpy
  from six.moves import range
  from rl_coach.agents.agent_interface import AgentInterface
  from rl_coach.architectures.network_wrapper import NetworkWrapper
  from rl_coach.base_parameters import AgentParameters, Device, DeviceType, DistributedTaskParameters, Frameworks
  from rl_coach.core_types import RunPhase, PredictionType, EnvironmentEpisodes, ActionType, Batch, Episode, StateType
  from rl_coach.core_types import Transition, ActionInfo, TrainingSteps, EnvironmentSteps, EnvResponse
  from rl_coach.logger import screen, Logger, EpisodeLogger
  from rl_coach.memories.episodic.episodic_experience_replay import EpisodicExperienceReplay
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import SpacesDefinition, VectorObservationSpace, GoalsSpace, AttentionActionSpace
  from rl_coach.utils import Signal, force_list
  from rl_coach.utils import dynamic_import_and_instantiate_module_from_params
  from rl_coach.memories.backend.memory_impl import get_memory_backend
  from rl_coach.core_types import TimeTypes
  from rl_coach.off_policy_evaluators.ope_manager import OpeManager
  from rl_coach.core_types import PickledReplayBuffer, CsvDataset
label_desc: Use image node_id 22 for calling the Agent obj's underlying member method code with example usage: obj._should_update_online_weights_to_target() and returns: should_update