class_docstr: Wrapped DqnAgent that supports recycled training.
class_docstr_tok: ["Wrapped","DqnAgent","that","supports","recycled","training","."]
code: def __init__(
      self,
      time_step_spec,
      action_spec,
      *args,
      reset_mode=None,
      reset_freq=200000,
      reset_frac=0.0,
      reset_target_models=False,
      reset_actor=True,
      reset_critic=True,
      reset_algo="low_score",
      neuron_score_algo="activation",
      dead_neuron_threshold=0.0,
      scale_recycled_weights=False,
      recycled_incoming_scaler=1,
      recycled_outgoing_scaler=0,
      init_method="zero",
      log_interval=10000,
      log_batch_size=256,
      reset_freq_scale=1,
      **kwargs,
  ):
      super().__init__(time_step_spec, action_spec, *args, **kwargs)
      self.reset_mode = reset_mode
      self.reset_freq = int(reset_freq * reset_freq_scale)
      self.reset_frac = reset_frac
      self.reset_algo = reset_algo
      self.reset_target_models = reset_target_models
      self.reset_actor = reset_actor
      self.reset_critic = reset_critic
      self.neuron_score_algo = neuron_score_algo
      self.dead_neuron_threshold = dead_neuron_threshold
      self.scale_recycled_weights = scale_recycled_weights
      self.recycled_incoming_scaler = recycled_incoming_scaler
      self.recycled_outgoing_scaler = recycled_outgoing_scaler
      self.init_method = init_method
      self.log_interval = log_interval
      self.log_batch_size = log_batch_size
  
      net_observation_spec = time_step_spec.observation
      critic_spec = (net_observation_spec, action_spec)
      self._target_critic_network_1 = (
          common.maybe_copy_target_network_with_checks(
              self._critic_network_1,
              None,
              input_spec=critic_spec,
              name="TargetCriticNetwork1",
          )
      )
      self._target_critic_network_1 = (
          common.maybe_copy_target_network_with_checks(
              self._critic_network_2,
              None,
              input_spec=critic_spec,
              name="TargetCriticNetwork2",
          )
      )
  
imports: import functools
  import os
  from absl import app
  from absl import flags
  from absl import logging
  import gin
  import numpy
  import reverb
  from rigl.rl.tfagents import sparse_tanh_normal_projection_network
  import tensorflow
  from tf_agents.agents import tf_agent
  from tf_agents.agents.sac import sac_agent
  from tf_agents.environments import suite_mujoco
  from tf_agents.keras_layers import inner_reshape
  from tf_agents.metrics import py_metrics
  from tf_agents.networks import nest_map
  from tf_agents.networks import sequential
  from tf_agents.policies import greedy_policy
  from tf_agents.policies import py_tf_eager_policy
  from tf_agents.policies import random_py_policy
  from tf_agents.replay_buffers import reverb_replay_buffer
  from tf_agents.replay_buffers import reverb_utils
  from tf_agents.train import actor
  from tf_agents.train import learner
  from tf_agents.train import triggers
  from tf_agents.train.utils import spec_utils
  from tf_agents.train.utils import strategy_utils
  from tf_agents.train.utils import train_utils
  from tf_agents.utils import common
  from tf_agents.utils import object_identity
label_desc: Use image node_id 1 to create a new RecycledSacAgent object from inherited base classes: sac_agent with example: obj = RecycledSacAgent(time_step_spec, action_spec)