<p>In YoLo if you are only using convolution layers , the size of the output gird changes.</p>

<p>For example if you have size of:</p>

<ol>
<li><p>320x320, output size is 10x10</p></li>
<li><p>608x608, output size is 19x19</p></li>
</ol>

<p>You then calculate loss on these w.r.t to the ground truth grid which is similarly adjusted.</p>

<p>Thus you can back propagate loss without adding any more parameters.</p>

<p>Refer yolov1 paper for the loss function:</p>

<p><a href="https://i.stack.imgur.com/K6zaA.png" rel="nofollow noreferrer">Loss Function from the paper</a></p>

<p>You thus can in theory only adjust this function which depends upon the grid size and no <strong>model parameters</strong> and you should be good to go.</p>

<p>Paper Link: <a href="https://arxiv.org/pdf/1506.02640.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1506.02640.pdf</a></p>

<p>In the video explanation by the author mentions the same.</p>

<p><strong>Time: 14:53</strong></p>

<p><a href="https://www.youtube.com/watch?v=GBu2jofRJtk&amp;list=PLV1NMsIkAYhBs-k7Zw6fPQ8bBFufhU6BK" rel="nofollow noreferrer">Video Link</a></p>
Perform multi-scale training (yolov2)
<p>I am wondering how the multi-scale training in <a href="https://arxiv.org/pdf/1612.08242.pdf" rel="nofollow noreferrer">YOLOv2</a> works.</p>

<p>In the paper, it is stated that:</p>

<blockquote>
  <p>The original YOLO uses an input resolution of 448 × 448. ith the addition of anchor boxes we changed the resolution to 416×416. However, <strong>since our model only uses convolutional and pooling layers it can be resized on the fly</strong>. We want YOLOv2 to be robust to running on images of different sizes so we train this into the model. Instead of fixing the input image size we change the network every few iterations. Every 10 batches our network randomly chooses a new image dimension size. "Since our model downsamples by a factor of 32, we pull from the following multiples of 32: {320, 352, ..., 608}. Thus the smallest option is 320 × 320 and the largest is 608 × 608. We resize the network to that dimension and continue training. "</p>
</blockquote>

<p>I don't get how a network <strong>with only convolutional and pooling layers</strong> allow input of different resolutions. From my experience of building neural networks, if you change the resolution of the input to different scale, the number of parameters of this network will change, that is, the structure of this network will change.</p>

<p>So, how does YOLOv2 change this <em>on the fly</em>? </p>

<p>I read the configuration file for yolov2, but all I got was a <code>random=1</code> statement... </p>