code: def UnsupervisedLossNumpy(y_pred, embedded_x, obf_vars, eps=1e-9):
      errors = y_pred - embedded_x
      reconstruction_errors = np.multiply(errors, obf_vars) ** 2
      batch_means = np.mean(embedded_x, axis=0)
      batch_means = np.where(batch_means == 0, 1, batch_means)
  
      batch_stds = np.std(embedded_x, axis=0, ddof=1) ** 2
      batch_stds = np.where(batch_stds == 0, batch_means, batch_stds)
      features_loss = np.matmul(reconstruction_errors, 1 / batch_stds)
      # compute the number of obfuscated variables to reconstruct
      nb_reconstructed_variables = np.sum(obf_vars, axis=1)
      # take the mean of the reconstructed variable errors
      features_loss = features_loss / (nb_reconstructed_variables + eps)
      # here we take the mean per batch, contrary to the paper
      loss = np.mean(features_loss)
      return loss
  
imports: from dataclasses import dataclass
  from typing import List
  import numpy
  from sklearn.metrics import roc_auc_score, mean_squared_error, mean_absolute_error, accuracy_score, log_loss, balanced_accuracy_score, mean_squared_log_error
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: UnsupervisedLossNumpy(y_pred, embedded_x, obf_vars, eps) and returns: loss