class_docstr: This code was developed by jbpatel@mit.edu.
      
class_docstr_tok: ["This","code","was","developed","by","jbpatel","@","mit.edu","."]
code: def __init__(self, weights):
      nb_cl = len(weights)
      self.weights = np.ones((nb_cl, nb_cl))
      for class_idx, class_weight in weights.items():
          self.weights[0][class_idx] = class_weight
          self.weights[class_idx][0] = class_weight
      self.__name__ = "w_categorical_crossentropy_function"
      self.metric = 0.0
      self.diceMetric = 0.0
      self.smooth = 1.0
  
imports: import numpy
  import itertools
label_desc: Use image node_id 1 to create a new WeightedCategoricalCrossEntropy object from inherited base classes: object with example: obj = WeightedCategoricalCrossEntropy(weights)