0

Here is the setup:

test_observations : 6,767;
train_observations: 73,268;
train/test batch_size = 50;

How should I set the batch_size, test_iter, test_interval, max_iter?

Thank you!

Shai
  • 111,146
  • 38
  • 238
  • 371
AMayer
  • 415
  • 5
  • 19
  • Your understanding is correct – kli_nlpr Sep 18 '16 at 02:51
  • 1
    Possible duplicate of [Caffe | solver.prototxt values setting strategy](http://stackoverflow.com/questions/33780779/caffe-solver-prototxt-values-setting-strategy) – Shai Sep 19 '16 at 14:38

1 Answers1

1

So your validation size is 6,767 and your validation batch size is 50. your test_iter = validation set/ validation_batch_size = 6,767/50 = 135 (approx.) so that it will almost cover the validation set. and test interval, you can choose any value - its the amount of iterations after which your network will test the performance on the validation set. For larger network the use values like 5k for test_interval. for your network test_interval of 1000 seems to be fine.

for finding max_iter, you have to choose the number of epochs you want to go, i.e., number of times you want to cover your training size (lets say 2 for this- choose this number wisely not to overfit network). And one more thing there is no implementation of epoch in caffe currently but its effect can be seen from this formula. max_iter = #epochs * (training set/training_batch_size) = 2 * (73,268/50) = 29,000 (approx). so that it will go over your training set twice, and after training for 1k images, it will validate on your 6,767 images for optimization.

Dharma
  • 2,425
  • 3
  • 26
  • 40
  • A minor correction to @dharma's answer: number of (train) images processed in Caffe is batch_size * test_interval, therefore, part of the last sentence should read "after training for 50,000 images....", assuming batch_size=50 and test_interval=1000. – Sarge Feb 23 '17 at 01:19
  • @Dharma Are you sure its for the validation and not for the test ? because I can see each iteration output for loss , so validation is done each iteration ? – Stav Bodik May 24 '18 at 14:31