class_docstr: Calculate losses for Light Head R-CNN and report them.
  
  This is used to train Light Head R-CNN in the joint training scheme
  [#LHRCNN]_.
  
  .. [#LHRCNN] Zeming Li, Chao Peng, Gang Yu, Xiangyu Zhang, Yangdong Deng,     Jian Sun. Light-Head R-CNN: In Defense of Two-Stage Object Detector.     arXiv preprint arXiv:1711.07264.
  
  The losses include:
  
  * :obj:`rpn_loc_loss`: The localization loss for         Region Proposal Network (RPN).
  * :obj:`rpn_cls_loss`: The classification loss for RPN.
  * :obj:`roi_loc_loss`: The localization loss for the head module.
  * :obj:`roi_cls_loss`: The classification loss for the head module.
  
  Args:
      light_head_rcnn (~light_head_rcnn.links.light_head_rcnn.LightHeadRCNN):
          A Light Head R-CNN model that is going to be trained.
      rpn_sigma (float): Sigma parameter for the localization loss
          of Region Proposal Network (RPN). The default value is 3,
          which is the value used in [#LHRCNN]_.
      roi_sigma (float): Sigma paramter for the localization loss of
          the head. The default value is 1, which is the value used
          in [#LHRCNN]_.
      anchor_target_creator: An instantiation of
          :class:`~chainercv.links.model.faster_rcnn.AnchorTargetCreator`.
      proposal_target_creator: An instantiation of
          :class:`~light_head_rcnn.links.model.utils.ProposalTargetCreator`.
class_docstr_tok: ["Calculate","losses","for","Light","Head","R-CNN","and","report","them",".","This","is","used","to","train","Light","Head","R-CNN","in","the","joint","training","scheme","[","#","LHRCNN","]","_",".","..","[","#","LHRCNN","]","Zeming","Li",",","Chao","Peng",",","Gang","Yu",",","Xiangyu","Zhang",",","Yangdong","Deng",",","Jian","Sun",".","Light-Head","R-CNN",":","In","Defense","of","Two-Stage","Object","Detector",".","arXiv","preprint","arXiv:1711.07264",".","The","losses","include",":","*",":","obj",":","`","rpn_loc_loss","`",":","The","localization","loss","for","Region","Proposal","Network","(","RPN",")",".","*",":","obj",":","`","rpn_cls_loss","`",":","The","classification","loss","for","RPN",".","*",":","obj",":","`","roi_loc_loss","`",":","The","localization","loss","for","the","head","module",".","*",":","obj",":","`","roi_cls_loss","`",":","The","classification","loss","for","the","head","module",".","Args",":","light_head_rcnn","(","~light_head_rcnn.links.light_head_rcnn.LightHeadRCNN",")",":","A","Light","Head","R-CNN","model","that","is","going","to","be","trained",".","rpn_sigma","(","float",")",":","Sigma","parameter","for","the","localization","loss","of","Region","Proposal","Network","(","RPN",")",".","The","default","value","is","3",",","which","is","the","value","used","in","[","#","LHRCNN","]","_.","roi_sigma","(","float",")",":","Sigma","paramter","for","the","localization","loss","of","the","head",".","The","default","value","is","1",",","which","is","the","value","used","in","[","#","LHRCNN","]","_.","anchor_target_creator",":","An","instantiation","of",":","class",":","`","~chainercv.links.model.faster_rcnn.AnchorTargetCreator","`",".","proposal_target_creator",":","An","instantiation","of",":","class",":","`","~light_head_rcnn.links.model.utils.ProposalTargetCreator","`","."]
code: def __init__(
      self,
      light_head_rcnn,
      rpn_sigma=3.0,
      roi_sigma=1.0,
      n_ohem_sample=256,
      anchor_target_creator=None,
      proposal_target_creator=None,
  ):
      super(LightHeadRCNNTrainChain, self).__init__()
      with self.init_scope():
          self.light_head_rcnn = light_head_rcnn
      self.rpn_sigma = rpn_sigma
      self.roi_sigma = roi_sigma
      self.n_ohem_sample = n_ohem_sample
  
      if anchor_target_creator is None:
          self.anchor_target_creator = AnchorTargetCreator()
      else:
          self.anchor_target_creator = anchor_target_creator
  
      if proposal_target_creator is None:
          self.proposal_target_creator = ProposalTargetCreator(
              n_sample=None
          )
      else:
          self.proposal_target_creator = proposal_target_creator
  
      self.loc_normalize_mean = light_head_rcnn.loc_normalize_mean
      self.loc_normalize_std = light_head_rcnn.loc_normalize_std
  
file_path: chainercv/chainercv/links/model/light_head_rcnn/light_head_rcnn_train_chain.py
imports: from __future__ import division
  import numpy
  import warnings
  import chainer
  from chainer.backends import cuda
  import chainer.functions
  from chainercv.links.model.faster_rcnn.utils.anchor_target_creator import AnchorTargetCreator
  from chainercv.links.model.faster_rcnn.utils.proposal_target_creator import ProposalTargetCreator
label_desc: Use image node_id 1 to create a new LightHeadRCNNTrainChain object from inherited base classes: chainer with example: obj = LightHeadRCNNTrainChain(light_head_rcnn, rpn_sigma, roi_sigma, n_ohem_sample, anchor_target_creator, proposal_target_creator)