code: def create_binary_convolution_model():
      # Input variables denoting the features and label data
      feature_var = C.input((num_channels, image_height, image_width))
      label_var = C.input((num_classes))
  
      # apply model to input
      scaled_input = C.element_times(
          C.constant(0.00390625), feature_var
      )
  
      # first layer is ok to be full precision
      z = C.layers.Convolution((3, 3), 64, pad=True, activation=C.relu)(
          scaled_input
      )
      z = C.layers.MaxPooling((3, 3), strides=(2, 2))(z)
  
      z = C.layers.BatchNormalization(map_rank=1)(z)
      z = BinaryConvolution(z, (3, 3), 128, channels=64, pad=True)
      z = C.layers.MaxPooling((3, 3), strides=(2, 2))(z)
  
      z = C.layers.BatchNormalization(map_rank=1)(z)
      z = BinaryConvolution(z, (3, 3), 128, channels=128, pad=True)
      z = C.layers.MaxPooling((3, 3), strides=(2, 2))(z)
  
      z = C.layers.BatchNormalization(map_rank=1)(z)
      z = BinaryConvolution(
          z, (1, 1), num_classes, channels=128, pad=True
      )
      z = C.layers.AveragePooling((z.shape[1], z.shape[2]))(z)
      z = C.reshape(z, (num_classes,))
  
      # Add binary regularization (ala Gang Hua)
      weight_sum = C.constant(0)
      for p in z.parameters:
          if p.name == "filter":
              weight_sum = C.plus(
                  weight_sum, C.reduce_sum(C.minus(1, C.square(p)))
              )
      bin_reg = C.element_times(0.000005, weight_sum)
  
      # After the last layer, we need to apply a learnable scale
      SP = C.parameter(shape=z.shape, init=0.001)
      z = C.element_times(z, SP)
  
      # loss and metric
      ce = C.cross_entropy_with_softmax(z, label_var)
      ce = C.plus(ce, bin_reg)
      pe = C.classification_error(z, label_var)
  
      return C.combine([z, ce, pe])
  
file_path: CNTK/Examples/Extensibility/BinaryConvolution/binary_convnet.py
imports: import os
  import sys
  import cntk
  from custom_convolution_ops import *
  from ConvNet_CIFAR10_DataAug import *
label_desc: Use image node_id 2 for calling a global function with example usage: create_binary_convolution_model() and returns: C