code: def create_trainer(network, epoch_size, num_epochs, minibatch_size):
      # CNTK weights new gradient by (1-momentum) for unit gain,
      # thus we divide Caffe's learning rate by (1-momentum)
      initial_learning_rate = 0.45  # equal to 0.045 in caffe
      initial_learning_rate *= minibatch_size / 32
      learn_rate_adjust_interval = 2
      learn_rate_decrease_factor = 0.94
  
      # Set learning parameters
      lr_per_mb = []
      learning_rate = initial_learning_rate
      for i in range(0, num_epochs, learn_rate_adjust_interval):
          lr_per_mb.extend([learning_rate] * learn_rate_adjust_interval)
          learning_rate *= learn_rate_decrease_factor
  
      lr_schedule = C.learners.learning_parameter_schedule(
          lr_per_mb, epoch_size=epoch_size
      )
      mm_schedule = C.learners.momentum_schedule(0.9)
      l2_reg_weight = 0.0001  # CNTK L2 regularization is per sample, thus same as Caffe
  
      # Create learner
      learner = C.learners.nesterov(
          network["ce"].parameters,
          lr_schedule,
          mm_schedule,
          l2_regularization_weight=l2_reg_weight,
      )
  
      # Create trainer
      return C.train.Trainer(
          network["output"], (network["ce"], network["pe"]), learner
      )
  
file_path: CNTK/Examples/Image/Classification/GoogLeNet/InceptionV3/Python/InceptionV3_ImageNet.py
imports: import os
  import math
  import argparse
  import numpy
  import cntk
  from InceptionV3 import inception_v3_norm_model
label_desc: Use image node_id 3 for calling a global function with example usage: create_trainer(network, epoch_size, num_epochs, minibatch_size) and returns: C