code: def create_criterion_function(model):
      @Function
      @Signature(
          query=Sequence[
              SparseTensor[LanguageUnderstanding.vocab_size]
          ],
          labels=Sequence[
              SparseTensor[LanguageUnderstanding.num_labels]
          ],
      )
      def criterion(query, labels):
          z = model(query)
          ce = cross_entropy_with_softmax(z, labels)
          errs = classification_error(z, labels)
          return (ce, errs)
  
      return criterion
  
file_path: CNTK/Tests/EndToEndTests/EvalClientTests/CNTKLibraryCSEvalExamplesTest/train_models_for_evaluation.py
imports: import os
  import sys
  import argparse
  import zipfile
  import math
  import cntk
  import prepare_test_data
  import TrainResNet_CIFAR10
  import LanguageUnderstanding
  from cntk.layers.typing import *
  from cntk import *
  from cntk.logging import *
label_desc: Use image node_id 3 for calling a global function with example usage: create_criterion_function(model) and returns: criterion, ce,  errs