docstr: Intializes variables related to main loss function
docstr_tok: ["Intializes","variables","related","to","main","loss","function"]
code: def do_loss_initializations(
      self, yloss_type, diversity_loss_type, feature_weights
  ):
      """Intializes variables related to main loss function"""
  
      self.loss_weights = [
          yloss_type,
          diversity_loss_type,
          feature_weights,
      ]
  
      # define the loss parts
      self.yloss_type = yloss_type
      self.diversity_loss_type = diversity_loss_type
  
      # define feature weights
      if feature_weights != self.feature_weights_input:
          self.feature_weights_input = feature_weights
          if feature_weights == "inverse_mad":
              normalized_mads = self.data_interface.get_valid_mads(
                  normalized=True
              )
              feature_weights = {}
              for feature in normalized_mads:
                  feature_weights[feature] = round(
                      1 / normalized_mads[feature], 2
                  )
  
          feature_weights_list = []
          for feature in self.data_interface.ohe_encoded_feature_names:
              if feature in feature_weights:
                  feature_weights_list.append(feature_weights[feature])
              else:
                  feature_weights_list.append(1.0)
          self.feature_weights_list = torch.tensor(feature_weights_list)
  
      # define different parts of loss function
      self.yloss_opt = torch.nn.BCEWithLogitsLoss()
  
imports: import copy
  import random
  import timeit
  import numpy
  import torch
  from dice_ml import diverse_counterfactuals
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
label_desc: Use image node_id 7 for calling the DicePyTorch obj's underlying member method code with example usage: obj.do_loss_initializations(yloss_type, diversity_loss_type, feature_weights) without return types