code: def plot_gate_outputs_to_numpy(gate_targets, gate_outputs):
      fig, ax = plt.subplots(figsize=(12, 3))
      ax.scatter(
          range(len(gate_targets)),
          gate_targets,
          alpha=0.5,
          color="green",
          marker="+",
          s=1,
          label="target",
      )
      ax.scatter(
          range(len(gate_outputs)),
          gate_outputs,
          alpha=0.5,
          color="red",
          marker=".",
          s=1,
          label="predicted",
      )
  
      plt.xlabel("Frames (Green target, Red predicted)")
      plt.ylabel("Gate State")
      plt.tight_layout()
  
      fig.canvas.draw()
      data = save_figure_to_numpy(fig)
      plt.close()
      return data
  
imports: from enum import Enum
  from typing import Optional, Tuple
  import librosa
  import matplotlib.pylab
  import numpy
  import torch
  from einops import rearrange
  from numba import jit, prange
  from nemo.collections.tts.torch.tts_data_types import DATA_STR2DATA_CLASS, MAIN_DATA_TYPES, WithLens
  from nemo.utils import logging
  from nemo.utils.decorators import deprecated
label_desc: Use image node_id 20 for calling a global function with example usage: plot_gate_outputs_to_numpy(gate_targets, gate_outputs) and returns: data