<p>The method is a util function of Faster R-CNN, so I assume you understood what is the "anchor" proposed in Faster R-CNN.</p>

<ul>
<li>"Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks" <a href="https://arxiv.org/abs/1506.01497" rel="nofollow noreferrer">https://arxiv.org/abs/1506.01497</a></li>
</ul>

<p><code>base_size</code> and <code>anchor_scales</code> determines the size of the anchor. 
For example, when <code>base_size=16</code> and <code>anchor_scales=[8, 16, 32]</code> (and <code>ratio=1.0</code>), height and width of the anchor will be <code>16 * [8, 16, 32] = (128, 256, 512)</code>, as you expected.
<code>ratio</code> determines the height and width aspect ratio.</p>

<p>(I might be wrong in below paragraph, please correct if I'm wrong.)</p>

<p>I think <code>base_size</code> need to be set as the size of the current hidden layer's scale. In the <code>chainercv</code> Faster R-CNN implementation, <code>extractor</code>'s feature is fed into <code>rpn</code> (region proposal network) and <code>generate_anchor_base</code> is used in <code>rpn</code>. So you need to take care what is the feature of <code>extractor</code>'s output. <code>chainercv</code> uses VGG16 as the feature extractor, and <code>conv5_3</code> layer is used as extracted feature (see <a href="https://github.com/chainer/chainercv/blob/master/chainercv/links/model/faster_rcnn/faster_rcnn_vgg.py#L109" rel="nofollow noreferrer">here</a>), this layer is a place where <code>max_pooling_2d</code> is applied 4 times, which results 2^4=16 times smallen feature.</p>

<p>For the another question, I think your understanding is correct, <code>py - h / 2</code> will be negative value. But this <code>anchor_base</code> value is just a relative value. Once <code>anchor_base</code> is prepared at the initialization of model (<a href="https://github.com/chainer/chainercv/blob/master/chainercv/links/model/faster_rcnn/region_proposal_network.py#L55-L56" rel="nofollow noreferrer">here</a>), actual (absolute value) <code>anchor</code> is created in each forward call (<a href="https://github.com/chainer/chainercv/blob/master/chainercv/links/model/faster_rcnn/region_proposal_network.py#L116-L117" rel="nofollow noreferrer">here</a>) in <code>_enumerate_shifted_anchor</code> method.</p>
What does generate_anchor_base()'s arguments mean?
<p><a href="https://github.com/chainer/chainercv/blob/master/chainercv/links/model/faster_rcnn/utils/generate_anchor_base.py" rel="nofollow noreferrer">Github page</a></p>

<p>Looking <code>generate_anchor_base</code> method, which is Faster R-CNN util method in ChainerCV.</p>

<p>What is the <code>base_size = 16</code>?  I saw in the Documentation that it is </p>

<blockquote>
  <p>The width and the height of the reference window. </p>
</blockquote>

<p>But what does "reference window" mean?    </p>

<p>Also it says that <code>anchor_scales=[8, 16, 32]</code> are the areas of the anchors but I thought that that the areas are (128, 256, 512)</p>

<p>Another question:<br>
If the <code>base size</code> is 16 and <code>h = 128</code> and <code>w=128</code>, Does that mean <code>anchor_base[index, 0] = py - h / 2</code> is a negative value?
since py = 8 and and h/2 = 128/2</p>