class_docstr: Wrapped DqnAgent that supports recycled training.
class_docstr_tok: ["Wrapped","DqnAgent","that","supports","recycled","training","."]
code: def _rescale_weights(
      self, neuron_mask, var, new_weights, axis, scaler
  ):
      non_dead_count = neuron_mask.shape[0] - tf.reduce_sum(neuron_mask)
      non_recycled_norm = tf.reduce_sum(
          (
              tf.norm(var, axis=axis)
              * tf.cast(1 - neuron_mask, tf.float32)
          )
      ) / tf.cast(non_dead_count, tf.float32)
  
      new_recycled_norm = non_recycled_norm * scaler
      weights_norm_per_neuron = tf.norm(
          new_weights, axis=axis, keepdims=True
      )
      new_weights = new_weights / weights_norm_per_neuron
      new_weights = new_recycled_norm * new_weights
      return new_weights
  
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 19 for calling the RecycledSacAgent obj's underlying member method code with example usage: obj._rescale_weights(neuron_mask, var, new_weights, axis, scaler) and returns: new_weights