code: def conv_net(inputs, hparams):
      """Builds the ConvNet from Kelz 2016."""
      with slim.arg_scope(
          [slim.conv2d, slim.fully_connected],
          activation_fn=tf.nn.relu,
          weights_initializer=slim.variance_scaling_initializer(
              factor=2.0, mode="FAN_AVG", uniform=True
          ),
      ):
          net = inputs
          i = 0
          for (
              conv_temporal_size,
              conv_freq_size,
              num_filters,
              freq_pool_size,
              dropout_amt,
          ) in zip(
              hparams.temporal_sizes,
              hparams.freq_sizes,
              hparams.num_filters,
              hparams.pool_sizes,
              hparams.dropout_keep_amts,
          ):
              net = slim.conv2d(
                  net,
                  num_filters,
                  [conv_temporal_size, conv_freq_size],
                  scope="conv" + str(i),
                  normalizer_fn=slim.batch_norm,
              )
              if freq_pool_size > 1:
                  net = slim.max_pool2d(
                      net,
                      [1, freq_pool_size],
                      stride=[1, freq_pool_size],
                      scope="pool" + str(i),
                  )
              if dropout_amt < 1:
                  net = slim.dropout(
                      net, dropout_amt, scope="dropout" + str(i)
                  )
              i += 1
  
          # Flatten while preserving batch and time dimensions.
          dims = tf.shape(net)
          net = tf.reshape(
              net,
              (dims[0], dims[1], net.shape[2] * net.shape[3]),
              "flatten_end",
          )
  
          net = slim.fully_connected(
              net, hparams.fc_size, scope="fc_end"
          )
          net = slim.dropout(
              net, hparams.fc_dropout_keep_amt, scope="dropout_end"
          )
  
          return net
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  from magenta.common import flatten_maybe_padded_sequences
  from magenta.common import tf_utils
  from magenta.contrib import cudnn_rnn
  from magenta.contrib import rnn
  from magenta.contrib import training
  from magenta.models.onsets_frames_transcription import constants
  from magenta.models.onsets_frames_transcription import infer_util
  from magenta.models.onsets_frames_transcription import metrics
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tf_slim
label_desc: Use image node_id 1 for calling a global function with example usage: conv_net(inputs, hparams) and returns: net