class_docstr: Focal loss for heatmaps.
  
  Parameters
  ----------
  from_logits : bool
      Whether predictions are after sigmoid or softmax.
  batch_axis : int
      Batch axis.
  weight : float
      Loss weight.
class_docstr_tok: ["Focal","loss","for","heatmaps",".","Parameters","--","--","--","--","--","from_logits",":","bool","Whether","predictions","are","after","sigmoid","or","softmax",".","batch_axis",":","int","Batch","axis",".","weight",":","float","Loss","weight","."]
docstr: Loss forward
docstr_tok: ["Loss","forward"]
code: def hybrid_forward(self, F, pred, label):
      """Loss forward"""
      if not self._from_logits:
          pred = F.sigmoid(pred)
      pos_inds = label == 1
      neg_inds = label < 1
      neg_weights = F.power(1 - label, 4)
      pos_loss = F.log(pred) * F.power(1 - pred, 2) * pos_inds
      neg_loss = (
          F.log(1 - pred) * F.power(pred, 2) * neg_weights * neg_inds
      )
  
      # normalize
      num_pos = F.clip(F.sum(pos_inds), a_min=1, a_max=1e30)
      pos_loss = F.sum(pos_loss)
      neg_loss = F.sum(neg_loss)
      return -(pos_loss + neg_loss) / num_pos
  
imports: from __future__ import absolute_import
  from mxnet import gluon
  from mxnet import nd
  from mxnet.gluon.loss import Loss, _apply_weighting, _reshape_like
label_desc: Use image node_id 2 for calling the HeatmapFocalLoss obj's underlying member method code with example usage: obj.hybrid_forward(F, pred, label) and returns: unknown