class_docstr: Target assigner to compute classification and regression targets.
class_docstr_tok: ["Target","assigner","to","compute","classification","and","regression","targets","."]
docstr: Create classification weights for each anchor.
  
  Positive (matched) anchors are associated with a weight of
  positive_class_weight and negative (unmatched) anchors are associated with
  a weight of negative_class_weight. When anchors are ignored, weights are set
  to zero. By default, both positive/negative weights are set to 1.0,
  but they can be adjusted to handle class imbalance (which is almost always
  the case in object detection).
  
  Args:
    match: a matcher.Match object that provides a matching between anchors
      and groundtruth boxes.
    groundtruth_weights: a float tensor of shape [M] indicating the weight to
      assign to all anchors match to a particular groundtruth box.
  
  Returns:
    a float32 tensor with shape [num_anchors] representing classification
    weights.
docstr_tok: ["Create","classification","weights","for","each","anchor",".","Positive","(","matched",")","anchors","are","associated","with","a","weight","of","positive_class_weight","and","negative","(","unmatched",")","anchors","are","associated","with","a","weight","of","negative_class_weight",".","When","anchors","are","ignored",",","weights","are","set","to","zero",".","By","default",",","both","positive\/negative","weights","are","set","to","1.0",",","but","they","can","be","adjusted","to","handle","class","imbalance","(","which","is","almost","always","the","case","in","object","detection",")",".","Args",":","match",":","a","matcher.Match","object","that","provides","a","matching","between","anchors","and","groundtruth","boxes",".","groundtruth_weights",":","a","float","tensor","of","shape","[","M","]","indicating","the","weight","to","assign","to","all","anchors","match","to","a","particular","groundtruth","box",".","Returns",":","a","float32","tensor","with","shape","[","num_anchors","]","representing","classification","weights","."]
code: def _create_classification_weights(self, match, groundtruth_weights):
      """Create classification weights for each anchor.
  
      Positive (matched) anchors are associated with a weight of
      positive_class_weight and negative (unmatched) anchors are associated with
      a weight of negative_class_weight. When anchors are ignored, weights are set
      to zero. By default, both positive/negative weights are set to 1.0,
      but they can be adjusted to handle class imbalance (which is almost always
      the case in object detection).
  
      Args:
        match: a matcher.Match object that provides a matching between anchors
          and groundtruth boxes.
        groundtruth_weights: a float tensor of shape [M] indicating the weight to
          assign to all anchors match to a particular groundtruth box.
  
      Returns:
        a float32 tensor with shape [num_anchors] representing classification
        weights.
      """
      return match.gather_based_on_match(
          groundtruth_weights,
          ignored_value=0.0,
          unmatched_value=self._negative_class_weight,
      )
  
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 9 for calling the TargetAssigner obj's underlying member method code with example usage: obj._create_classification_weights(match, groundtruth_weights) and returns: match