code: def train_faster_rcnn_e2e(cfg):
      # Input variables denoting features and labeled ground truth rois (as 5-tuples per roi)
      image_input = input_variable(
          shape=(cfg.NUM_CHANNELS, cfg.IMAGE_HEIGHT, cfg.IMAGE_WIDTH),
          dynamic_axes=[Axis.default_batch_axis()],
          name=cfg["MODEL"].FEATURE_NODE_NAME,
      )
      roi_input = input_variable(
          (cfg.INPUT_ROIS_PER_IMAGE, 5),
          dynamic_axes=[Axis.default_batch_axis()],
      )
      dims_input = input_variable(
          (6), dynamic_axes=[Axis.default_batch_axis()]
      )
      dims_node = alias(dims_input, name="dims_input")
  
      # Instantiate the Faster R-CNN prediction model and loss function
      loss, pred_error = create_faster_rcnn_model(
          image_input, roi_input, dims_node, cfg
      )
  
      if cfg["CNTK"].DEBUG_OUTPUT:
          print("Storing graphs and models to %s." % cfg.OUTPUT_PATH)
          plot(
              loss,
              os.path.join(
                  cfg.OUTPUT_PATH,
                  "graph_frcn_train_e2e." + cfg["CNTK"].GRAPH_TYPE,
              ),
          )
  
      # Set learning parameters
      e2e_lr_factor = cfg["MODEL"].E2E_LR_FACTOR
      e2e_lr_per_sample_scaled = [
          x * e2e_lr_factor for x in cfg["CNTK"].E2E_LR_PER_SAMPLE
      ]
      mm_schedule = momentum_schedule(cfg["CNTK"].MOMENTUM_PER_MB)
  
      print("Using base model:   {}".format(cfg["MODEL"].BASE_MODEL))
      print("lr_per_sample:      {}".format(e2e_lr_per_sample_scaled))
  
      train_model(
          image_input,
          roi_input,
          dims_input,
          loss,
          pred_error,
          e2e_lr_per_sample_scaled,
          mm_schedule,
          cfg["CNTK"].L2_REG_WEIGHT,
          cfg["CNTK"].E2E_MAX_EPOCHS,
          cfg,
      )
  
      return create_faster_rcnn_eval_model(
          loss, image_input, dims_input, cfg
      )
  
imports: from __future__ import print_function
  import numpy
  import os, sys
  import argparse
  import easydict
  import cntk
  from cntk import Trainer, load_model, Axis, input_variable, parameter, times, combine, softmax, roipooling, plus, element_times, CloneMethod, alias, Communicator, reduce_sum
  from cntk.core import Value
  from cntk.io import MinibatchData
  from cntk.initializer import normal
  from cntk.layers import placeholder, Constant, Sequential
  from cntk.learners import momentum_sgd, learning_parameter_schedule_per_sample, momentum_schedule
  from cntk.logging import log_number_of_parameters, ProgressPrinter
  from cntk.logging.graph import find_by_name, plot
  from cntk.losses import cross_entropy_with_softmax
  from cntk.metrics import classification_error
  from _cntk_py import force_deterministic_algorithms
  from utils.rpn.rpn_helpers import create_rpn, create_proposal_target_layer, create_proposal_layer
  from utils.annotations.annotations_helper import parse_class_map_file
  from utils.od_mb_source import ObjectDetectionMinibatchSource
  from utils.proposal_helpers import ProposalProvider
  from FastRCNN.FastRCNN_train import clone_model, clone_conv_layers, create_fast_rcnn_predictor, create_detection_losses
label_desc: Use image node_id 8 for calling a global function with example usage: train_faster_rcnn_e2e(cfg) and returns: create_faster_rcnn_eval_model