title: Compute the number of epoch from iteration in training?
body: <p>I have a Caffe prototxt as follows:</p>
  
  <pre><code>stepsize: 20000
  iter_size: 4
  batch_size: 10
  gamma =0.1
  </code></pre>
  
  <p>in which, the dataset has <strong>40.000</strong> images. It means after <strong>20000</strong> iters, the learning rate will decrease <strong>10</strong> times. In pytorch, I want to compute the number of the epoch to have the same behavior in caffe (for learning rate). How many epoch should I use to decrease learning rate 10 times (note that, we have <strong>iter_size=4 and batch_size=10</strong>). Thanks</p>
  
  <p>Ref: <a href="https://stackoverflow.com/questions/4752626/epoch-vs-iteration-when-training-neural-networks">Epoch vs Iteration when training neural networks</a></p>
  
  <p>My answer: Example: if you have <strong>40000</strong> training examples, and batch size is 10, then it will take <strong>40000/10 =4000</strong> iterations to complete 1 epoch. Hence, <strong>20000</strong> iters to reduce learning rate in caffe will same as <strong>5</strong> epochs in pytorch.</p>