class_docstr: Wrapped DqnAgent that supports recycled training.
class_docstr_tok: ["Wrapped","DqnAgent","that","supports","recycled","training","."]
docstr: log the number of dead neurons per hidden layer in a network.
  
  Args:
    model: network
    network_name: name of the network
    intermediate_act: dict of layers activation
    intermediate_act_grad: dict of layers grad of activation
docstr_tok: ["log","the","number","of","dead","neurons","per","hidden","layer","in","a","network",".","Args",":","model",":","network","network_name",":","name","of","the","network","intermediate_act",":","dict","of","layers","activation","intermediate_act_grad",":","dict","of","layers","grad","of","activation"]
code: def log_dead_neurons_count(
      self, model, network_name, intermediate_act, intermediate_act_grad
  ):
      """log the number of dead neurons per hidden layer in a network.
  
      Args:
        model: network
        network_name: name of the network
        intermediate_act: dict of layers activation
        intermediate_act_grad: dict of layers grad of activation
      """
      total_dead_neurons = 0
      total_hidden_count = 0
      all_layers_score = self.calculate_neuron_score_all_layers(
          model, intermediate_act, intermediate_act_grad
      )
  
      for layer_count, (layer_name, layer_score) in enumerate(
          all_layers_score.items()
      ):
          _, num_dead_neurons = self.get_dead_neurons(layer_score)
          total_dead_neurons += num_dead_neurons
          total_hidden_count += layer_score.shape[0]
          with tf.name_scope("dead_neurons/" + network_name + "/"):
              tf.compat.v2.summary.scalar(
                  "layer_" + str(layer_count + 1) + "_" + layer_name,
                  num_dead_neurons,
              )
  
          log_act_hist = functools.partial(
              self.log_histogram,
              layer_name + str(self.train_step_counter),
              layer_score,
          )
          tf.cond(
              self.train_step_counter % 100000 == 0,
              log_act_hist,
              lambda: None,
          )
  
      with tf.name_scope("dead_neurons/" + network_name + "/"):
          tf.compat.v2.summary.scalar(
              "total_dead_neurons", total_dead_neurons
          )
      with tf.name_scope("dead_neurons/" + network_name + "/"):
          tf.compat.v2.summary.scalar(
              "dead_neurons_percentage",
              (total_dead_neurons / total_hidden_count) * 100,
          )
  
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 7 for calling the RecycledSacAgent obj's underlying member method code with example usage: obj.log_dead_neurons_count(model, network_name, intermediate_act, intermediate_act_grad) without return types