class_docstr: Base class for YOLOv2 and YOLOv2Tiny.
  
  A subclass of this class should have :obj:`_extractor`,
  :obj:`_models`, and :obj:`_anchors`.
class_docstr_tok: ["Base","class","for","YOLOv2","and","YOLOv2Tiny",".","A","subclass","of","this","class","should","have",":","obj",":","`","_extractor","`",",",":","obj",":","`","_models","`",",","and",":","obj",":","`","_anchors","`","."]
docstr: Compute localization, objectness, and classification from a batch of images.
  
  This method computes three variables, :obj:`locs`, :obj:`objs`,
  and :obj:`confs`.
  :meth:`self._decode` converts these variables to bounding box
  coordinates and confidence scores.
  These variables are also used in training YOLOv2.
  
  Args:
      x (chainer.Variable): A variable holding a batch of images.
  
  Returns:
      tuple of chainer.Variable:
      This method returns three variables, :obj:`locs`,
      :obj:`objs`, and :obj:`confs`.
  
      * **locs**: A variable of float arrays of shape                 :math:`(B, K, 4)`,                 where :math:`B` is the number of samples in the batch and                 :math:`K` is the number of default bounding boxes.
      * **objs**: A variable of float arrays of shape                 :math:`(B, K)`.
      * **confs**: A variable of float arrays of shape                 :math:`(B, K, n\_fg\_class)`.
docstr_tok: ["Compute","localization",",","objectness",",","and","classification","from","a","batch","of","images",".","This","method","computes","three","variables",",",":","obj",":","`","locs","`",",",":","obj",":","`","objs","`",",","and",":","obj",":","`","confs","`",".",":","meth",":","`","self._decode","`","converts","these","variables","to","bounding","box","coordinates","and","confidence","scores",".","These","variables","are","also","used","in","training","YOLOv2",".","Args",":","x","(","chainer.Variable",")",":","A","variable","holding","a","batch","of","images",".","Returns",":","tuple","of","chainer.Variable",":","This","method","returns","three","variables",",",":","obj",":","`","locs","`",",",":","obj",":","`","objs","`",",","and",":","obj",":","`","confs","`",".","*","*","*","locs","*","*",":","A","variable","of","float","arrays","of","shape",":","math",":","`","(","B",",","K",",","4",")","`",",","where",":","math",":","`","B","`","is","the","number","of","samples","in","the","batch","and",":","math",":","`","K","`","is","the","number","of","default","bounding","boxes",".","*","*","*","objs","*","*",":","A","variable","of","float","arrays","of","shape",":","math",":","`","(","B",",","K",")","`",".","*","*","*","confs","*","*",":","A","variable","of","float","arrays","of","shape",":","math",":","`","(","B",",","K",",","n\\_fg\\_class",")","`","."]
code: def forward(self, x):
      """Compute localization, objectness, and classification from a batch of images.
  
          This method computes three variables, :obj:`locs`, :obj:`objs`,
          and :obj:`confs`.
          :meth:`self._decode` converts these variables to bounding box
          coordinates and confidence scores.
          These variables are also used in training YOLOv2.
  
          Args:
              x (chainer.Variable): A variable holding a batch of images.
  
          Returns:
              tuple of chainer.Variable:
              This method returns three variables, :obj:`locs`,
              :obj:`objs`, and :obj:`confs`.
  
              * **locs**: A variable of float arrays of shape \
                  :math:`(B, K, 4)`, \
                  where :math:`B` is the number of samples in the batch and \
                  :math:`K` is the number of default bounding boxes.
              * **objs**: A variable of float arrays of shape \
                  :math:`(B, K)`.
              * **confs**: A variable of float arrays of shape \
                  :math:`(B, K, n\_fg\_class)`.
          """
  
      h = self.subnet(self.extractor(x))
      h = F.transpose(h, (0, 2, 3, 1))
      h = F.reshape(h, (h.shape[0], -1, 4 + 1 + self.n_fg_class))
      locs = h[:, :, :4]
      objs = h[:, :, 4]
      confs = h[:, :, 5:]
      return locs, objs, confs
  
imports: from __future__ import division
  import itertools
  import numpy
  import chainer
  from chainer.backends import cuda
  import chainer.functions
  from chainer.links import Convolution2D
  from chainercv.links import Conv2DBNActiv
  from chainercv import utils
  from chainercv.links.model.yolo.yolo_base import YOLOBase
label_desc: Use image node_id 4 for calling the YOLOv2Base obj's underlying member method code with example usage: obj.forward(x) and returns: locs,  objs,  confs