class_docstr: This code was developed by jbpatel@mit.edu.
      
class_docstr_tok: ["This","code","was","developed","by","jbpatel","@","mit.edu","."]
code: def metric_acc(self, y_true, y_pred):
      import keras
      from keras import backend as K
      from keras.layers import Lambda
  
      # Only need first channel of y_true!
      y_true1 = K.expand_dims(y_true[..., 0], axis=-1)
      y_true_complement = Lambda((lambda arg: K.ones_like(arg) - arg))(
          y_true1
      )
      y_true_onehot = keras.layers.concatenate(
          [y_true_complement, y_true1], axis=-1
      )
      return keras.metrics.categorical_accuracy(y_true_onehot, y_pred)
  
imports: import numpy
  import itertools
label_desc: Use image node_id 11 for calling the WeightedCategoricalCrossEntropy obj's underlying member method code with example usage: obj.metric_acc(y_true, y_pred) and returns: keras