docstr: Computes the overall loss
docstr_tok: ["Computes","the","overall","loss"]
code: def compute_loss(self, cfs, desired_range, desired_class):
      """Computes the overall loss"""
      self.yloss = self.compute_yloss(cfs, desired_range, desired_class)
      self.proximity_loss = (
          self.compute_proximity_loss(
              cfs, self.query_instance_normalized
          )
          if self.proximity_weight > 0
          else 0.0
      )
      self.sparsity_loss = (
          self.compute_sparsity_loss(cfs)
          if self.sparsity_weight > 0
          else 0.0
      )
      self.loss = np.reshape(
          np.array(
              self.yloss
              + (self.proximity_weight * self.proximity_loss)
              + self.sparsity_weight * self.sparsity_loss
          ),
          (-1, 1),
      )
      index = np.reshape(np.arange(len(cfs)), (-1, 1))
      self.loss = np.concatenate([index, self.loss], axis=1)
      return self.loss
  
imports: import copy
  import random
  import timeit
  import numpy
  import pandas
  from raiutils.exceptions import UserConfigValidationException
  from dice_ml import diverse_counterfactuals
  from dice_ml.constants import ModelTypes
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
label_desc: Use image node_id 15 for calling the DiceGenetic obj's underlying member method code with example usage: obj.compute_loss(cfs, desired_range, desired_class) and returns: self