class_docstr: Region Proposal Network of Feature Pyramid Networks.
  
  Args:
      scales (tuple of floats): The scales of feature maps.
class_docstr_tok: ["Region","Proposal","Network","of","Feature","Pyramid","Networks",".","Args",":","scales","(","tuple","of","floats",")",":","The","scales","of","feature","maps","."]
docstr: Calculates anchor boxes.
  
  Args:
      sizes (iterable of tuples of two ints): An iterable of
          :math:`(H_l, W_l)`, where :math:`H_l` and :math:`W_l`
          are height and width of the :math:`l`-th feature map.
  
  Returns:
      list of arrays:
      The shape of the :math:`l`-th array is :math:`(H_l * W_l * A, 4)`,
      where :math:`A` is the number of anchor ratios.
docstr_tok: ["Calculates","anchor","boxes",".","Args",":","sizes","(","iterable","of","tuples","of","two","ints",")",":","An","iterable","of",":","math",":","`","(","H_l",",","W_l",")","`",",","where",":","math",":","`","H_l","`","and",":","math",":","`","W_l","`","are","height","and","width","of","the",":","math",":","`","l","`","-th","feature","map",".","Returns",":","list","of","arrays",":","The","shape","of","the",":","math",":","`","l","`","-th","array","is",":","math",":","`","(","H_l","*","W_l","*","A",",","4",")","`",",","where",":","math",":","`","A","`","is","the","number","of","anchor","ratios","."]
code: def anchors(self, sizes):
      """Calculates anchor boxes.
  
      Args:
          sizes (iterable of tuples of two ints): An iterable of
              :math:`(H_l, W_l)`, where :math:`H_l` and :math:`W_l`
              are height and width of the :math:`l`-th feature map.
  
      Returns:
          list of arrays:
          The shape of the :math:`l`-th array is :math:`(H_l * W_l * A, 4)`,
          where :math:`A` is the number of anchor ratios.
  
      """
      anchors = []
      for l, (H, W) in enumerate(sizes):
          v, u, ar = np.meshgrid(
              np.arange(W), np.arange(H), self._anchor_ratios
          )
          w = np.round(1 / np.sqrt(ar) / self._scales[l])
          h = np.round(w * ar)
          anchor = np.stack((u, v, h, w)).reshape((4, -1)).transpose()
          anchor[:, :2] = (anchor[:, :2] + 0.5) / self._scales[l]
          anchor[:, 2:] *= (self._anchor_size << l) * self._scales[l]
          # yxhw -> tlbr
          anchor[:, :2] -= anchor[:, 2:] / 2
          anchor[:, 2:] += anchor[:, :2]
          anchors.append(self.xp.array(anchor, dtype=np.float32))
  
      return anchors
  
file_path: chainercv/chainercv/links/model/fpn/rpn.py
imports: from __future__ import division
  import numpy
  import chainer
  from chainer.backends import cuda
  import chainer.functions
  from chainer import initializers
  import chainer.links
  from chainercv.links.model.fpn.misc import argsort
  from chainercv.links.model.fpn.misc import choice
  from chainercv.links.model.fpn.misc import exp_clip
  from chainercv.links.model.fpn.misc import smooth_l1
  from chainercv import utils
label_desc: Use image node_id 3 for calling the RPN obj's underlying member method code with example usage: obj.anchors(sizes) and returns: anchors