class_docstr: Atari100k Ranibow Agent with recycled parameters.
class_docstr_tok: ["Atari100k","Ranibow","Agent","with","recycled","parameters","."]
code: def _weight_recycle(self, update_step, online_params):
      # Neuron/layer recycling starts if reset_mode is not None.
      # Otherwise, we log dead neurons over training for standard agent.
      is_intermediated = self.weight_recycler.is_intermediated_required(
          update_step
      )
      # get intermediate activation per layer to calculate neuron score
      intermediates = (
          self.get_intermediates(online_params)
          if is_intermediated
          else None
      )
      log_dict_neurons = self.weight_recycler.maybe_log_deadneurons(
          update_step, intermediates
      )
      # logging dead neurons.
      self._log_stats(log_dict_neurons, update_step)
      if self.is_debugging:
          log_dict_intersected = self.weight_recycler.intersected_dead_neurons_with_last_reset(
              intermediates, update_step
          )
          self._log_stats(log_dict_intersected, update_step)
  
      # Neuron/layer recyling.
      self._rng, key = jax.random.split(self._rng)
      (
          online_params,
          opt_state,
      ) = self.weight_recycler.maybe_update_weights(
          update_step,
          intermediates,
          online_params,
          key,
          self.optimizer_state,
      )
      self.optimizer_state = opt_state
      return online_params
  
file_path: dopamine/dopamine/labs/redo/recycled_atari100k_rainbow_agent.py
imports: from dopamine.jax.agents.full_rainbow import full_rainbow_agent
  from dopamine.labs.atari_100k import atari_100k_rainbow_agent
  from dopamine.labs.redo import networks
  from dopamine.labs.redo import weight_recyclers
  from dopamine.metrics import statistics_instance
  import gin
  import jax
  import jax.numpy
  import optax
label_desc: Use image node_id 5 for calling the RecycledAtari100kRainbowAgent obj's underlying member method code with example usage: obj._weight_recycle(update_step, online_params) and returns: online_params