class_docstr: Target assigner to compute classification and regression targets.
class_docstr_tok: ["Target","assigner","to","compute","classification","and","regression","targets","."]
docstr: Returns a regression target for each anchor.
  
  Args:
    anchors: a BoxList representing N anchors
    groundtruth_boxes: a BoxList representing M groundtruth_boxes
    match: a matcher.Match object
  
  Returns:
    reg_targets: a float32 tensor with shape [N, box_code_dimension]
docstr_tok: ["Returns","a","regression","target","for","each","anchor",".","Args",":","anchors",":","a","BoxList","representing","N","anchors","groundtruth_boxes",":","a","BoxList","representing","M","groundtruth_boxes","match",":","a","matcher.Match","object","Returns",":","reg_targets",":","a","float32","tensor","with","shape","[","N",",","box_code_dimension","]"]
code: def _create_regression_targets(
      self, anchors, groundtruth_boxes, match
  ):
      """Returns a regression target for each anchor.
  
      Args:
        anchors: a BoxList representing N anchors
        groundtruth_boxes: a BoxList representing M groundtruth_boxes
        match: a matcher.Match object
  
      Returns:
        reg_targets: a float32 tensor with shape [N, box_code_dimension]
      """
      matched_gt_boxes = match.gather_based_on_match(
          groundtruth_boxes.get(),
          unmatched_value=tf.zeros(4),
          ignored_value=tf.zeros(4),
      )
      matched_gt_boxlist = box_list.BoxList(matched_gt_boxes)
      if groundtruth_boxes.has_field(KEYPOINTS_FIELD_NAME):
          groundtruth_keypoints = groundtruth_boxes.get_field(
              KEYPOINTS_FIELD_NAME
          )
          matched_keypoints = match.gather_based_on_match(
              groundtruth_keypoints,
              unmatched_value=tf.zeros(
                  groundtruth_keypoints.get_shape()[1:]
              ),
              ignored_value=tf.zeros(
                  groundtruth_keypoints.get_shape()[1:]
              ),
          )
          matched_gt_boxlist.add_field(
              KEYPOINTS_FIELD_NAME, matched_keypoints
          )
      matched_reg_targets = self._box_coder.encode(
          matched_gt_boxlist, anchors
      )
      match_results_shape = (
          shape_utils.combined_static_and_dynamic_shape(
              match.match_results
          )
      )
  
      # Zero out the unmatched and ignored regression targets.
      unmatched_ignored_reg_targets = tf.tile(
          self._default_regression_target(), [match_results_shape[0], 1]
      )
      matched_anchors_mask = match.matched_column_indicator()
      reg_targets = tf.where(
          matched_anchors_mask,
          matched_reg_targets,
          unmatched_ignored_reg_targets,
      )
      return reg_targets
  
file_path: DALI/docs/examples/use_cases/tensorflow/efficientdet/pipeline/anchors_utils/target_assigner.py
imports: import tensorflow.compat.v1
  from .None import box_list
  from .None import shape_utils
label_desc: Use image node_id 5 for calling the TargetAssigner obj's underlying member method code with example usage: obj._create_regression_targets(anchors, groundtruth_boxes, match) and returns: reg_targets