class_docstr: Encode classification training target given matching results.
  
  This encoder will assign training target of matched bounding boxes to
  ground-truth label + 1 and negative samples with label 0.
  Ignored samples will be assigned with `ignore_label`, whose default is -1.
  
  Parameters
  ----------
  ignore_label : float
      Assigned to un-matched samples, they are neither positive or negative during
      training, and should be excluded in loss function. Default is -1.
class_docstr_tok: ["Encode","classification","training","target","given","matching","results",".","This","encoder","will","assign","training","target","of","matched","bounding","boxes","to","ground-truth","label","+","1","and","negative","samples","with","label","0",".","Ignored","samples","will","be","assigned","with","`","ignore_label","`",",","whose","default","is","-1",".","Parameters","--","--","--","--","--","ignore_label",":","float","Assigned","to","un-matched","samples",",","they","are","neither","positive","or","negative","during","training",",","and","should","be","excluded","in","loss","function",".","Default","is","-1","."]
docstr: HybridBlock, handle multi batch correctly
  
  Parameters
  ----------
  samples: (B, N), value +1 (positive), -1 (negative), 0 (ignore)
  matches: (B, N), value range [0, M)
  refs: (B, M), value range [0, num_fg_class), excluding background
  
  Returns
  -------
  targets: (B, N), value range [0, num_fg_class + 1), including background
docstr_tok: ["HybridBlock",",","handle","multi","batch","correctly","Parameters","--","--","--","--","--","samples",":","(","B",",","N",")",",","value","+1","(","positive",")",",","-1","(","negative",")",",","0","(","ignore",")","matches",":","(","B",",","N",")",",","value","range","[","0",",","M",")","refs",":","(","B",",","M",")",",","value","range","[","0",",","num_fg_class",")",",","excluding","background","Returns","--","--","--","-","targets",":","(","B",",","N",")",",","value","range","[","0",",","num_fg_class","+","1",")",",","including","background"]
code: def hybrid_forward(self, F, samples, matches, refs):
      """HybridBlock, handle multi batch correctly
  
      Parameters
      ----------
      samples: (B, N), value +1 (positive), -1 (negative), 0 (ignore)
      matches: (B, N), value range [0, M)
      refs: (B, M), value range [0, num_fg_class), excluding background
  
      Returns
      -------
      targets: (B, N), value range [0, num_fg_class + 1), including background
  
      """
      # samples (B, N) (+1, -1, 0: ignore), matches (B, N) [0, M), refs (B, M)
      # reshape refs (B, M) -> (B, 1, M) -> (B, N, M)
      refs = F.broadcast_like(
          F.reshape(refs, (0, 1, -1)), matches, lhs_axes=1, rhs_axes=1
      )
      # ids (B, N, M) -> (B, N), value [0, M + 1), 0 reserved for background class
      target_ids = F.pick(refs, matches, axis=2) + 1
      # samples 0: set ignore samples to ignore_label
      targets = F.where(
          samples > 0.5,
          target_ids,
          F.ones_like(target_ids) * self._ignore_label,
      )
      # samples -1: set negative samples to 0
      targets = F.where(samples < -0.5, F.zeros_like(targets), targets)
      return targets
  
imports: from __future__ import absolute_import
  import numpy
  from mxnet import gluon
  from mxnet import nd
  from .bbox import BBoxCornerToCenter, NumPyBBoxCornerToCenter
label_desc: Use image node_id 2 for calling the MultiClassEncoder obj's underlying member method code with example usage: obj.hybrid_forward(F, samples, matches, refs) and returns: targets