code: def criterion(data, label_one_hot):
      z = model(
          data
      )  # apply model. Computes a non-normalized log probability for every output class.
      loss = cntk.cross_entropy_with_softmax(
          z, label_one_hot
      )  # this applies softmax to z under the hood
      metric = cntk.classification_error(z, label_one_hot)
      return loss, metric
  
imports: from __future__ import print_function
  import cntk
  import numpy
  import scipy.sparse
label_desc: Use image node_id 2 for calling a global function with example usage: criterion(data, label_one_hot) and returns: loss,  metric