class_docstr: Training targets generator for Single-shot Object Detection.
  
  Parameters
  ----------
  iou_thresh : float
      IOU overlap threshold for maximum matching, default is 0.5.
  neg_thresh : float
      IOU overlap threshold for negative mining, default is 0.5.
  negative_mining_ratio : float
      Ratio of hard vs positive for negative mining.
  stds : array-like of size 4, default is (0.1, 0.1, 0.2, 0.2)
      Std value to be divided from encoded values.
class_docstr_tok: ["Training","targets","generator","for","Single-shot","Object","Detection",".","Parameters","--","--","--","--","--","iou_thresh",":","float","IOU","overlap","threshold","for","maximum","matching",",","default","is","0.5.","neg_thresh",":","float","IOU","overlap","threshold","for","negative","mining",",","default","is","0.5.","negative_mining_ratio",":","float","Ratio","of","hard","vs","positive","for","negative","mining",".","stds",":","array-like","of","size","4",",","default","is","(","0.1",",","0.1",",","0.2",",","0.2",")","Std","value","to","be","divided","from","encoded","values","."]
docstr: Generate training targets.
docstr_tok: ["Generate","training","targets","."]
code: def forward(self, anchors, cls_preds, gt_boxes, gt_ids):
      """Generate training targets."""
      anchors = self._center_to_corner(anchors.reshape((-1, 4)))
      ious = nd.transpose(
          nd.contrib.box_iou(anchors, gt_boxes), (1, 0, 2)
      )
      matches = self._matcher(ious)
      if self._use_negative_sampling:
          samples = self._sampler(matches, cls_preds, ious)
      else:
          samples = self._sampler(matches)
      cls_targets = self._cls_encoder(samples, matches, gt_ids)
      box_targets, box_masks = self._box_encoder(
          samples, matches, anchors, gt_boxes
      )
      return cls_targets, box_targets, box_masks
  
file_path: gluon-cv/gluoncv/model_zoo/ssd/target.py
imports: from __future__ import absolute_import
  from mxnet import nd
  from mxnet.gluon import Block
  from ...nn.matcher import CompositeMatcher, BipartiteMatcher, MaximumMatcher
  from ...nn.sampler import OHEMSampler, NaiveSampler
  from ...nn.coder import MultiClassEncoder, NormalizedBoxCenterEncoder
  from ...nn.bbox import BBoxCenterToCorner
label_desc: Use image node_id 2 for calling the SSDTargetGenerator obj's underlying member method code with example usage: obj.forward(anchors, cls_preds, gt_boxes, gt_ids) and returns: cls_targets,  box_targets,  box_masks