class_docstr: The validation module to check the difference between original Caffe and converted CNTK models
docstr:  The function executes CNTK forward and dumps watched nodes into temporary files with
      numpy.mat formats
  
  Args:
      None
  
  Return:
      bool: whether to validate the network
docstr_tok: ["The","function","executes","CNTK","forward","and","dumps","watched","nodes","into","temporary","files","with","numpy.mat","formats","Args",":","None","Return",":","bool",":","whether","to","validate","the","network"]
code: def val_network(self):
      """
       The function executes CNTK forward and dumps watched nodes into temporary files with
          numpy.mat formats
  
      Args:
          None
  
      Return:
          bool: whether to validate the network
      """
      if self._valid_solver.save_path is None:
          sys.stdout.write("ignore validation network...\n")
          return False
      val_inputs = [
          value
          for key, value in self._functions.items()
          if key in self._valid_solver.val_inputs
      ]
      val_nodes = [
          value
          for key, value in self._functions.items()
          if key in self._valid_solver.val_nodes.keys()
      ]
      if not os.path.exists(self._valid_solver.save_path):
          os.mkdir(self._valid_solver.save_path)
  
      def _parser_save_path(dir_path, node_name):
          file_name = ".".join((node_name, "npy"))
          file_name = file_name.replace("\\", ".")
          file_name = file_name.replace("/", ".")
          return os.path.join(dir_path, file_name)
  
      valid_augments = {}
      for val_input in val_inputs:
          source_val_input = self._valid_solver.val_inputs[
              val_input.name
          ][0]
          if len(source_val_input) == 2:
              [lower, upper] = source_val_input
              input_array = (upper - lower) * np.random.random_sample(
                  (1,) + val_input.shape
              )
          else:
              input_array = np.array(source_val_input).reshape(
                  (1,) + val_input.shape
              )
          valid_augments[val_input.name] = input_array.astype(
              np.float32
          )
          save_path = _parser_save_path(
              self._valid_solver.save_path, val_input.name
          )
          np.save(save_path, input_array)
      for val_node in val_nodes:
          used_augments = {
              augment: valid_augments[augment.name]
              for augment in val_node.arguments
          }
          val_results = val_node.forward(used_augments)
          output_array = list(val_results[1].values())[0]
          save_path = _parser_save_path(
              self._valid_solver.save_path,
              self._valid_solver.val_nodes[val_node.name],
          )
          np.save(save_path, output_array)
  
      return True
  
file_path: CNTK/bindings/python/cntk/contrib/crosstalkcaffe/validation/validcore.py
imports: import sys
  import os
  import numpy
  from .None import validcaffe
label_desc: Use image node_id 2 for calling the Validator obj's underlying member method code with example usage: obj.val_network() and returns: True, False, os