code: def midiae_ld_summary(ld_feat, outputs, step, db_key="loudness_db"):
      """Makes plots to inspect loudness/velocity components of MidiAE.
  
      Args:
        ld_feat: The input loudness feature to the network.
        outputs: Output dictionary from the MidiAe net.
        step: The step that the optimizer is currently on
        db_key: Name of the loudness key (power_db or loudness_db).
      """
      batch_size = int(ld_feat.shape[0])
      for i in range(batch_size):
          ld_input = np.squeeze(ld_feat[i])
          ld_rec = np.squeeze(outputs[f"{db_key}_rec"][i])
          vel_quant = np.squeeze(outputs["velocity_quant"][i])
  
          _midiae_ld_helper(
              ld_input,
              ld_rec,
              vel_quant,
              db_key,
              i,
              step,
              "q_vel",
              "midiae_decoder_ld",
          )
  
          if f"{db_key}_rec2" in outputs:
              ld_rec2 = np.squeeze(outputs[f"{db_key}_rec2"][i])
              _midiae_ld_helper(
                  ld_input,
                  ld_rec2,
                  vel_quant,
                  db_key,
                  i,
                  step,
                  "q_vel",
                  "midiae_decoder_ld2",
              )
  
          if "velocity" in outputs:
              vel = np.squeeze(outputs["velocity"][i])
  
              _midiae_ld_helper(
                  ld_input,
                  ld_rec,
                  vel,
                  db_key,
                  i,
                  step,
                  "vel",
                  "midiae_encoder_ld",
              )
  
imports: import io
  import ddsp
  from ddsp.core import tf_float32
  from ddsp.training.plotting import pianoroll_plot_setup
  import matplotlib.patches
  import matplotlib.pyplot
  from matplotlib.ticker import MaxNLocator
  import note_seq
  from note_seq import sequences_lib
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 13 for calling a global function with example usage: midiae_ld_summary(ld_feat, outputs, step, db_key) without return types