class_docstr: Wrapped DqnAgent that supports recycled training.
class_docstr_tok: ["Wrapped","DqnAgent","that","supports","recycled","training","."]
code: def get_mask_dead_neurons_weights(self, act, act_grad, model):
      model_layers = get_all_layers(model, filter_fn=is_dense_layer)
      all_layers_score = self.calculate_neuron_score_all_layers(
          model, act, act_grad
      )
      incoming_masks = {}
      outgoing_masks = {}
      dead_neuron_masks = {}
      for (
          layer,
          next_layer,
      ) in zip(model_layers[:-1], model_layers[1:]):
          incoming_var = layer.kernel
          outgoing_var = next_layer.kernel
          neurons_score = all_layers_score[layer.name]
          # TODO(gsokar) implement random and high score based on threshold.
          if self.reset_algo == "low_score":
              score = neurons_score
          else:
              raise ValueError(
                  "reset_alg:%s  is not valid." % self.reset_algo
              )
          mask, _ = self.get_dead_neurons(score)
          incoming_mask, outgoing_mask = self.create_mask_helper(
              mask, incoming_var.shape[0], outgoing_var.shape[1]
          )
          incoming_masks[layer.name] = incoming_mask
          outgoing_masks[next_layer.name] = outgoing_mask
          dead_neuron_masks[layer.name] = mask
      return dead_neuron_masks, incoming_masks, outgoing_masks
  
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 17 for calling the RecycledSacAgent obj's underlying member method code with example usage: obj.get_mask_dead_neurons_weights(act, act_grad, model) and returns: dead_neuron_masks,  incoming_masks,  outgoing_masks