class_docstr: A standard multi-layer perceptron 
class_docstr_tok: ["A","standard","multi-layer","perceptron"]
code: def _loss(self):
      # Weight decay loss
      for var in self.layers[0].vars.values():
          self.loss += FLAGS.weight_decay * tf.nn.l2_loss(var)
  
      # Cross entropy error
      if self.categorical:
          self.loss += metrics.masked_softmax_cross_entropy(
              self.outputs,
              self.placeholders["labels"],
              self.placeholders["labels_mask"],
          )
      # L2
      else:
          diff = self.labels - self.outputs
          self.loss += tf.reduce_sum(
              tf.sqrt(tf.reduce_sum(diff * diff, axis=1))
          )
  
imports: from collections import namedtuple
  import tensorflow
  import math
  import graphsage.layers
  import graphsage.metrics
  from .prediction import BipartiteEdgePredLayer
  from .aggregators import MeanAggregator, MaxPoolingAggregator, MeanPoolingAggregator, SeqAggregator, GCNAggregator
label_desc: Use image node_id 2 for calling the MLP obj's underlying member method code with example usage: obj._loss() without return types