Ning-Ding / Implementation-CVPR2015-CNN-for-ReID

Implementation for CVPR 2015 Paper: "An Improved Deep Learning Architecture for Person Re-Identification".
MIT License
147 stars 71 forks source link

Batch size and iteration #18

Open stemanik opened 7 years ago

stemanik commented 7 years ago

Hi, First of all thanks a lot for the code. This is sort of an absolute beginner question, but if you use 150 batch size samples, and the total images of the CUHK03 dataset are 13164, the numbers of iteration per epoch should be 13164/batch size, right?. If you use 30000 iteration don't you risk to fall in the overfitting problem? In the article, there was written that they use 210000 iteration, but they don't clarify if they use 210000 iterations per epoch or this number include all training iterations.

Thanks

Ning-Ding commented 7 years ago

Hi, to estimate how many iterations the model should be trained for this task is different with what you think. First, though the total images of the CUHK03 dataset are about 13000, they are not the direct input of the model. The input of the model is a pair of two images, and has two labels: positive and negative. If one person has 10 images and each camera has 5 images, the total positive instances are 25. If the ratio of positive instance to negative instance is 1:3, the total instances for one person are 100. So it may have 130000 training examples. The total params of the model are nearly 20 millions so it's fine with about 100k iterations. Hope this can help you.

stemanik commented 7 years ago

Ok, i understand the first part of your answer, but i still can not understand why with 20 millions params you need 100k iterations. what kind of formula you use to determine the iterations number? Thank you so much for your help!

Ning-Ding commented 7 years ago

There may be a formula to compute the number of iterations but I don't know what it is. In my opinion, at least let the model see every instance 5-20 times. Besides, saving the interval model weights and watching the loss curve also give you some help.

stemanik commented 7 years ago

Thanks!!

LG17 commented 7 years ago

Hi, Thanks a lot for the code. I wonder that if it's better to set the batch_size 128, or 32, 64 ? And how long does it take to run all the 100 * 30,000 epochs?

Thanks!

PrernaPrem commented 7 years ago

Hi , Can you please tell how many training samples you have used in the code and how many testing samples?

hs-ucsb commented 6 years ago

@Ning-Ding Hi, Can you please explain what the parameters of train method (inside main.py) denotes?