code: def bn_inception_train_and_eval(
      train_data,
      test_data,
      mean_data,
      num_quantization_bits=32,
      epoch_size=50000,
      max_epochs=200,
      minibatch_size=None,
      restore=True,
      log_to_file=None,
      num_mbs_per_log=100,
      gen_heartbeat=False,
      scale_up=False,
      profiling=False,
  ):
      _cntk_py.set_computation_network_trace_level(0)
  
      # NOTE: scaling up minibatch_size increases sample throughput. In 8-GPU machine,
      # ResNet110 samples-per-second is ~7x of single GPU, comparing to ~3x without scaling
      # up. However, bigger minibatch size on the same number of samples means less updates,
      # thus leads to higher training error. This is a trade-off of speed and accuracy
      if minibatch_size is None:
          mb_size = 128 * (
              Communicator.num_workers() if scale_up else 1
          )
      else:
          mb_size = minibatch_size
  
      progress_printer = ProgressPrinter(
          freq=num_mbs_per_log,
          tag="Training",
          log_to_file=log_to_file,
          rank=Communicator.rank(),
          gen_heartbeat=gen_heartbeat,
          num_epochs=max_epochs,
      )
  
      network = create_bn_inception()
      trainer = create_trainer(
          network,
          epoch_size,
          max_epochs,
          mb_size,
          num_quantization_bits,
          progress_printer,
      )
      train_source = create_image_mb_source(
          train_data,
          mean_data,
          True,
          total_number_of_samples=max_epochs * epoch_size,
      )
      test_source = create_image_mb_source(
          test_data,
          mean_data,
          False,
          total_number_of_samples=FULL_DATA_SWEEP,
      )
  
      train_and_test(
          network,
          trainer,
          train_source,
          test_source,
          max_epochs,
          mb_size,
          epoch_size,
          restore,
          profiling,
      )
  
file_path: CNTK/Examples/Image/Classification/GoogLeNet/BN-Inception/Python/BN_Inception_CIFAR10_Distributed.py
imports: from __future__ import print_function
  from __future__ import division
  import os
  import math
  import argparse
  import numpy
  import cntk
  import _cntk_py
  import cntk.io.transforms
  from cntk.debugging import start_profiler, stop_profiler
  from cntk.learners import learning_parameter_schedule, momentum_schedule, momentum_sgd
  from cntk.logging import ProgressPrinter, log_number_of_parameters
  from cntk.ops import input
  from cntk.io import ImageDeserializer, MinibatchSource, StreamDef, StreamDefs, FULL_DATA_SWEEP
  from cntk.train.distributed import data_parallel_distributed_learner, Communicator
  from cntk.train import training_session, CheckpointConfig, TestConfig, Trainer
  from BN_Inception_CIFAR10 import create_image_mb_source, create_bn_inception
label_desc: Use image node_id 3 for calling a global function with example usage: bn_inception_train_and_eval(train_data, test_data, mean_data, num_quantization_bits, epoch_size, max_epochs, minibatch_size, restore, log_to_file, num_mbs_per_log, gen_heartbeat, scale_up, profiling) without return types