code: def _compare_predictions_numerical(
      self, ref_preds, coreml_preds, snr_thresh=15, psnr_thresh=30
  ):
      ref_preds = ref_preds.flatten()
      coreml_preds = coreml_preds.flatten()
      noise = coreml_preds - ref_preds
      noise_var = np.mean(noise**2)
      signal_energy = np.mean(ref_preds**2)
      max_signal_energy = np.amax(ref_preds**2)
  
      if noise_var > 1e-6 and signal_energy > 1e-6:
          SNR = 10 * np.log10(signal_energy / noise_var)
          PSNR = 10 * np.log10(max_signal_energy / noise_var)
  
          print("SNR: {}, PSNR: {}".format(SNR, PSNR))
          print("noise var: ", np.mean(noise**2))
          print("max signal energy: ", np.amax(ref_preds**2))
          print("signal energy: ", np.mean(ref_preds**2))
  
          self.assertGreaterEqual(PSNR, psnr_thresh)
          self.assertGreaterEqual(SNR, snr_thresh)
  
imports: import itertools
  import unittest
  import numpy
  import pytest
  import coremltools.models.datatypes
  from coremltools import ComputeUnit
  from coremltools._deps import _HAS_TF_2, MSG_TF2_NOT_FOUND
  from coremltools.models import MLModel, neural_network
  from coremltools.models.utils import _is_macos, _macos_version
label_desc: Use image node_id 2 for calling the CorrectnessTest obj's underlying member method code with example usage: obj._compare_predictions_numerical(ref_preds, coreml_preds, snr_thresh, psnr_thresh) without return types