code: def neuron_conductance(net, test_input_tensor, neuron_selector=None):
      """
      We have identified that some of the neurons are not learning important features, while others are.
      Can we now understand what each of these important neurons are looking at in the input?
      For instance, are they identifying different features in the input or similar ones?
  
      To answer these questions, we can apply the third type of attributions available in Captum, **Neuron Attributions**.
      This allows us to understand what parts of the input contribute to activating a particular input neuron. For this example,
      we will apply Neuron Conductance, which divides the neuron's total conductance value into the contribution from each individual input feature.
  
      To use Neuron Conductance, we create a NeuronConductance object, analogously to Conductance,
      passing in the model as well as the module (layer) whose output we would like to understand, in this case, net.sigmoid1, as before.
      """
      neuron_selector = 0
      neuron_cond = NeuronConductance(net, net.sigmoid1)
  
      # We can now obtain the neuron conductance values for all the test examples by calling attribute on the NeuronConductance object.
      # Neuron Conductance requires the neuron index in the target layer for which attributions are requested as well as the target index for networks with multiple outputs,
      # similar to layer conductance. As before, we provide target = 1, corresponding to survival, and compute neuron conductance for neurons 0 and 10, the significant neurons identified above.
      # The neuron index can be provided either as a tuple or as just an integer if the layer output is 1-dimensional.
  
      neuron_cond_vals = neuron_cond.attribute(
          test_input_tensor, neuron_selector=neuron_selector, target=1
      )
      neuron_cond, _ = visualize_importances(
          feature_names,
          neuron_cond_vals.mean(dim=0).detach().numpy(),
          title=f"Average Feature Importances for Neuron {neuron_selector}",
      )
      mlflow.log_text(
          str(neuron_cond),
          "Avg_Feature_Importances_Neuron_"
          + str(neuron_selector)
          + ".txt",
      )
  
imports: import os
  from argparse import ArgumentParser
  import matplotlib.pyplot
  import numpy
  import pandas
  import torch
  from captum.attr import IntegratedGradients, LayerConductance, NeuronConductance
  from prettytable import PrettyTable
  from scipy import stats
  from sklearn.model_selection import train_test_split
  from torch import nn
  import mlflow
label_desc: Use image node_id 9 for calling a global function with example usage: neuron_conductance(net, test_input_tensor, neuron_selector) without return types