code: def plot_SequenceDNN_layer_outputs(dnn, simulation_data):
      # define layer out functions
      import theano
  
      get_conv_output = theano.function(
          [dnn.model.layers[0].input],
          dnn.model.layers[0].get_output(train=False),
          allow_input_downcast=True,
      )
      get_conv_relu_output = theano.function(
          [dnn.model.layers[0].input],
          dnn.model.layers[1].get_output(train=False),
          allow_input_downcast=True,
      )
      get_maxpool_output = theano.function(
          [dnn.model.layers[0].input],
          dnn.model.layers[-4].get_output(train=False),
          allow_input_downcast=True,
      )
      # get layer outputs for a positive simulation example
      pos_indx = np.where(simulation_data.y_valid == 1)[0][0]
      pos_X = simulation_data.X_valid[pos_indx : (pos_indx + 1)]
      conv_outputs = get_conv_output(pos_X).squeeze()
      conv_relu_outputs = get_conv_relu_output(pos_X).squeeze()
      maxpool_outputs = get_maxpool_output(pos_X).squeeze()
      # plot layer outputs
      fig = plt.figure(figsize=(15, 12))
      ax1 = fig.add_subplot(3, 1, 3)
      heatmap = ax1.imshow(
          conv_outputs,
          aspect="auto",
          interpolation="None",
          cmap="seismic",
      )
      fig.colorbar(heatmap)
      ax1.set_ylabel("Convolutional Filters")
      ax1.set_xlabel("Position")
      ax1.get_yaxis().set_ticks([])
      ax1.get_xaxis().set_ticks([])
      ax1.set_title(
          "SequenceDNN outputs from convolutional layer.\t\
      Locations of motif sites are highlighted in grey."
      )
  
      ax2 = fig.add_subplot(3, 1, 2)
      heatmap = ax2.imshow(
          conv_relu_outputs,
          aspect="auto",
          interpolation="None",
          cmap="seismic",
      )
      fig.colorbar(heatmap)
      ax2.set_ylabel("Convolutional Filters")
      ax2.get_yaxis().set_ticks([])
      ax2.get_xaxis().set_ticks([])
      ax2.set_title(
          "Convolutional outputs after ReLU transformation.\t\
      Locations of motif sites are highlighted in grey."
      )
  
      ax3 = fig.add_subplot(3, 1, 1)
      heatmap = ax3.imshow(
          maxpool_outputs,
          aspect="auto",
          interpolation="None",
          cmap="seismic",
      )
      fig.colorbar(heatmap)
      ax3.set_title("DNN outputs after max pooling")
      ax3.set_ylabel("Convolutional Filters")
      ax3.get_yaxis().set_ticks([])
      ax3.get_xaxis().set_ticks([])
  
      # highlight motif sites
      motif_scores = get_motif_scores(
          pos_X, simulation_data.motif_names
      )
      motif_sites = [np.argmax(motif_scores[0, i, :]) for i in [0, 1]]
      for motif_site in motif_sites:
          conv_output_start = motif_site - max(dnn.conv_width - 10, 0)
          conv_output_stop = motif_site + max(dnn.conv_width - 10, 0)
          ax1.axvspan(
              conv_output_start,
              conv_output_stop,
              color="grey",
              alpha=0.5,
          )
          ax2.axvspan(
              conv_output_start,
              conv_output_stop,
              color="grey",
              alpha=0.5,
          )
  
file_path: deepchem/contrib/dragonn/tutorial_utils.py
imports: from __future__ import division
  import random
  import inspect
  from collections import namedtuple, defaultdict, OrderedDict
  import numpy
  from sklearn.model_selection import train_test_split
  import simulations
  from simdna.synthetic import StringEmbeddable
  from utils import get_motif_scores, one_hot_encode
  from models import SequenceDNN
  from dragonn.plot import add_letters_to_axis, plot_motif
  import matplotlib.pyplot
  from matplotlib.lines import Line2D
label_desc: Use image node_id 5 for calling a global function with example usage: plot_SequenceDNN_layer_outputs(dnn, simulation_data) without return types