class_docstr: This code was developed by jbpatel@mit.edu.
      
class_docstr_tok: ["This","code","was","developed","by","jbpatel","@","mit.edu","."]
code: def loss_wcc_dist(self, y_true, y_pred):
      from keras import backend as K
      from keras.layers import concatenate, Lambda
  
      y_dist = Lambda(
          (lambda arg: K.expand_dims(arg[..., 1], axis=-1))
      )(y_true)
      y_true1 = Lambda(
          (lambda arg: K.expand_dims(arg[..., 0], axis=-1))
      )(y_true)
      y_true_complement = Lambda(lambda arg: (K.ones_like(arg) - arg))(
          y_true1
      )
      y_true_onehot = concatenate([y_true_complement, y_true1], axis=-1)
      y_pred_max = K.max(y_pred, axis=-1)
      y_pred_max = K.expand_dims(y_pred_max, axis=-1)
      # y_pred_max_mat = K.equal(y_pred, y_pred_max)
  
      wcc_loss = self.w_categorical_crossentropy_function(
          y_true1, y_pred
      )
      distTrans_loss = self.distTransErrorMatrix(
          y_true_onehot, y_dist, y_pred
      )
      total_loss = wcc_loss * distTrans_loss
  
      return total_loss
  
imports: import numpy
  import itertools
label_desc: Use image node_id 3 for calling the WeightedCategoricalCrossEntropy obj's underlying member method code with example usage: obj.loss_wcc_dist(y_true, y_pred) and returns: total_loss