class_docstr: Assign anchors to ground-truth targets. Produces anchor classification
  labels and bounding-box regression targets.
class_docstr_tok: ["Assign","anchors","to","ground-truth","targets",".","Produces","anchor","classification","labels","and","bounding-box","regression","targets","."]
code: def __init__(
      self,
      arg1,
      arg2,
      arg3,
      rpn_batch_size=256,
      rpn_fg_fraction=0.5,
      clobber_positives=False,
      positive_overlap=0.7,
      negative_overlap=0.3,
      param_str=None,
      name="AnchorTargetLayer",
      cfm_shape=None,
      deterministic=False,
  ):
      super(AnchorTargetLayer, self).__init__(
          [arg1, arg2, arg3], name=name
      )
      self._rpn_batch_size = rpn_batch_size
      self._rpn_fg_fraction = rpn_fg_fraction
      self._clobber_positives = clobber_positives
      self._positive_overlap = positive_overlap
      self._negative_overlap = negative_overlap
      self._param_str = (
          param_str
          if param_str is not None
          else "'feat_stride': 16\n'scales':\n - 8 \n - 16 \n - 32"
      )
  
      # parse the layer parameter string, which must be valid YAML
      layer_params = yaml.load(self._param_str)
      anchor_scales = layer_params.get("scales", (8, 16, 32))
      self._anchors = generate_anchors(scales=np.array(anchor_scales))
      self._num_anchors = self._anchors.shape[0]
      self._feat_stride = layer_params["feat_stride"]
      self._cfm_shape = cfm_shape
      self._determininistic_mode = deterministic
  
      if DEBUG:
          print("anchors:")
          print(self._anchors)
          print("anchor shapes:")
          print(
              np.hstack(
                  (
                      self._anchors[:, 2::4] - self._anchors[:, 0::4],
                      self._anchors[:, 3::4] - self._anchors[:, 1::4],
                  )
              )
          )
          self._counts = 1e-14  # avoid division by zero
          self._sums = np.zeros((1, 4))
          self._squared_sums = np.zeros((1, 4))
          self._fg_sum = 0
          self._bg_sum = 0
          self._count = 0
  
      # allow boxes to sit over the edge by a small amount
      self._allowed_border = False
  
imports: import os
  from cntk import output_variable
  from cntk.ops.functions import UserFunction
  import yaml
  import numpy
  import numpy.random
  from utils.rpn.generate_anchors import generate_anchors
  from utils.rpn.bbox_transform import bbox_transform
  from utils.cython_modules.cython_bbox import bbox_overlaps
label_desc: Use image node_id 1 to create a new AnchorTargetLayer object from inherited base classes: UserFunction with example: obj = AnchorTargetLayer(arg1, arg2, arg3, rpn_batch_size, rpn_fg_fraction, clobber_positives, positive_overlap, negative_overlap, param_str, name, cfm_shape, deterministic)