code: def _dist_diff(ymodel, ysim):
      """
      Calculate the normalized distribution of the differences of the elements
      of the output vectors.
      If difference >= original value then the normalized difference will be set to 1,
      meaning "very difference".
      If difference < original value then the normalized difference would be difference/original.
      """
  
      diff = {}
  
      for key in list(ysim.keys()):
          flattened_ysim = ysim[key].flatten()
          flattened_ymodel = np.array(ymodel[key]).flatten()
  
          diff[key] = np.absolute(
              flattened_ymodel - flattened_ysim
          ) / np.linalg.norm(flattened_ymodel - flattened_ysim)
          diff_vector = np.absolute(flattened_ymodel - flattened_ysim)
          abs_ymodel = np.absolute(flattened_ymodel)
  
          normalized_diff = np.zeros(diff_vector.shape)
          normalized_diff[
              (diff_vector >= abs_ymodel)
              & (abs_ymodel > 0)
              & (diff_vector > 0)
          ] = 1
  
          # Fill out the rest
          index = diff_vector < abs_ymodel
          normalized_diff[index] = (
              diff_vector[index] / abs_ymodel[index]
          )
  
          diff[key] = normalized_diff
  
      # ---Box Plot---
      f, ax = plt.subplots()
      pos = np.array(range(len(list(diff.values())))) + 1
      ax.boxplot(list(diff.values()), sym="k+", positions=pos)
  
      # --formatting
      plt.title("Layer-by-layer distribution of output differences")
      ax.set_xticklabels(list(diff.keys()))
      ax.set_ylabel("Normalized difference")
      ax.set_ylabel("Percent difference.")
      plt.xticks(rotation=90)
      plt.tight_layout()
  
      return f
  
imports: import json
  import os
  import shutil
  import uuid
  from collections import defaultdict
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  from hls4ml.model.graph import ModelGraph
  from hls4ml.model.layers import GRU, LSTM, SeparableConv1D, SeparableConv2D
label_desc: Use image node_id 24 for calling a global function with example usage: _dist_diff(ymodel, ysim) and returns: f