code: def compute_targets(gt_bb, rp_bb):
      """
      Given ground truth bounding boxes and proposed boxes, compute the regresssion
      targets according to:
  
      t_x = (x_gt - x) / w
      t_y = (y_gt - y) / h
      t_w = log(w_gt / w)
      t_h = log(h_gt / h)
  
      where (x,y) are bounding box centers and (w,h) are the box dimensions
      """
      # calculate the region proposal centers and width/height
      (x, y, w, h) = _get_xywh(rp_bb)
      (x_gt, y_gt, w_gt, h_gt) = _get_xywh(gt_bb)
  
      # the target will be how to adjust the bbox's center and width/height
      # note that the targets are generated based on the original RP, which has not
      # been scaled by the image resizing
      targets_dx = (x_gt - x) / w
      targets_dy = (y_gt - y) / h
      targets_dw = np.log(w_gt / w)
      targets_dh = np.log(h_gt / h)
  
      targets = np.concatenate(
          (
              targets_dx[:, np.newaxis],
              targets_dy[:, np.newaxis],
              targets_dw[:, np.newaxis],
              targets_dh[:, np.newaxis],
          ),
          axis=1,
      )
      return targets
  
imports: from __future__ import division
  from __future__ import print_function
  from builtins import zip
  import numpy
  import os
  from neon.util.persist import load_obj
  from neon.data.datasets import Dataset
  from neon.initializers import Constant, Xavier
  from neon.transforms import Rectlin
  from neon.layers import Conv, Pooling
label_desc: Use image node_id 9 for calling a global function with example usage: compute_targets(gt_bb, rp_bb) and returns: targets