code: def midiae_sp_summary(outputs, step):
      """Synth Params summaries."""
  
      batch_size = int(outputs["f0_hz"].shape[0])
      have_pred = "amps_pred" in outputs
      height = 12 if have_pred else 4
      rows = 3 if have_pred else 1
  
      for i in range(batch_size):
          # Amplitudes ----------------------------
          amps = np.squeeze(outputs["amps"][i])
          fig, ax = plt.subplots(
              nrows=rows, ncols=1, figsize=(8, height)
          )
          ax[0].plot(amps)
          ax[0].set_title("Amplitudes - synth_params")
  
          if have_pred:
              amps_pred = np.squeeze(outputs["amps_pred"][i])
              ax[1].plot(amps_pred)
              ax[1].set_title("Amplitudes - pred")
  
              amps_diff = amps - amps_pred
              ax[2].plot(amps_diff)
              ax[2].set_title("Amplitudes - diff")
  
              for ax in fig.axes:
                  ax.label_outer()
  
          fig_summary(f"amplitudes/amplitudes_{i + 1}", fig, step)
  
          # Harmonic Distribution ------------------
          hd = np.log(np.squeeze(outputs["hd"][i]) + 1e-8)
          fig, ax = plt.subplots(
              nrows=rows, ncols=1, figsize=(8, height)
          )
          im = ax[0].imshow(hd.T, aspect="auto", origin="lower")
          fig.colorbar(im, ax=ax[0])
          ax[0].set_title("Harmonic Distribution (log) - synth_params")
  
          if have_pred:
              hd_pred = np.log(np.squeeze(outputs["hd_pred"][i]) + 1e-8)
              im = ax[1].imshow(
                  hd_pred.T, aspect="auto", origin="lower"
              )
              fig.colorbar(im, ax=ax[1])
              ax[1].set_title("Harmonic Distribution (log) - pred")
  
              hd_diff = hd - hd_pred
              im = ax[2].imshow(
                  hd_diff.T, aspect="auto", origin="lower"
              )
              fig.colorbar(im, ax=ax[2])
              ax[2].set_title("Harmonic Distribution (log) - diff")
  
              for ax in fig.axes:
                  ax.label_outer()
  
          fig_summary(f"harmonic_dist/harmonic_dist_{i + 1}", fig, step)
  
          # Magnitudes ----------------------------
          noise = np.squeeze(outputs["noise"][i])
          fig, ax = plt.subplots(
              nrows=rows, ncols=1, figsize=(8, height)
          )
          im = ax[0].imshow(noise.T, aspect="auto", origin="lower")
          fig.colorbar(im, ax=ax[0])
          ax[0].set_title("Noise mags - synth_params")
  
          if have_pred:
              noise_pred = np.squeeze(outputs["noise_pred"][i])
              im = ax[1].imshow(
                  noise_pred.T, aspect="auto", origin="lower"
              )
              fig.colorbar(im, ax=ax[1])
              ax[1].set_title("Noise mags - pred")
  
              noise_diff = noise - noise_pred
              im = ax[2].imshow(
                  noise_diff.T, aspect="auto", origin="lower"
              )
              fig.colorbar(im, ax=ax[2])
              ax[2].set_title("Noise mags - diff")
              for ax in fig.axes:
                  ax.label_outer()
  
          fig_summary(f"noise_mags/noise_mags_{i + 1}", fig, step)
  
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 14 for calling a global function with example usage: midiae_sp_summary(outputs, step) without return types