class_docstr: A fixed layer for calculating integral result from distribution.
  
  This layer calculates the target location by :math: `sum{P(y_i) * y_i}`,
  P(y_i) denotes the softmax vector that represents the discrete distribution
  y_i denotes the discrete set, usually {0, 1, 2, ..., reg_max}
  
  Args:
      reg_max (int): The maximal value of the discrete set. Default: 16. You
          may want to reset it according to your new dataset or related
          settings.
class_docstr_tok: ["A","fixed","layer","for","calculating","integral","result","from","distribution",".","This","layer","calculates","the","target","location","by",":","math",":","`","sum","{","P","(","y_i",")","*","y_i","}","`",",","P","(","y_i",")","denotes","the","softmax","vector","that","represents","the","discrete","distribution","y_i","denotes","the","discrete","set",",","usually","{","0",",","1",",","2",",","...",",","reg_max","}","Args",":","reg_max","(","int",")",":","The","maximal","value","of","the","discrete","set",".","Default",":","16",".","You","may","want","to","reset","it","according","to","your","new","dataset","or","related","settings","."]
code: def __init__(self, reg_max=16):
      super(Integral, self).__init__()
      self.reg_max = reg_max
      self.register_buffer(
          "project", torch.linspace(0, self.reg_max, self.reg_max + 1)
      )
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init, DepthwiseSeparableConvModule
  from mmcv.cnn import constant_init, kaiming_init
  from mmcv.runner import force_fp32
  from mmdet.core import anchor_inside_flags, bbox2distance, bbox_overlaps, build_assigner, build_sampler, distance2bbox, distance2kps, kps2distance, images_to_levels, multi_apply, multiclass_nms, reduce_mean, unmap
  from ..builder import HEADS, build_loss
  from .anchor_head import AnchorHead
  from .base_dense_head import BaseDenseHead
  from .dense_test_mixins import BBoxTestMixin
label_desc: Use image node_id 1 to create a new Integral object from inherited base classes: nn with example: obj = Integral(reg_max)