experiencor / keras-yolo3

Training and Detecting Objects with YOLO3
MIT License
1.61k stars 861 forks source link

What is "train_times" and "grid_scales"? #310

Open brian123214 opened 3 years ago

brian123214 commented 3 years ago

In the config.json, there is a parameter called "train_times", and it is described as "the number of time to cycle through the training set, useful for small dataset". What is the difference between train_times and epoch? Also, in config.json, there is a parameter callled ""grid_scales", and the default is [1, 1, 1]. I'm assuming this is related to how yolov3 has three detection layers? If I wanted it to have 4 detection layers, would I set it to [1, 1, 1, 1] and also manually add in a fourth detection layer in the model?

lexuansanh commented 3 years ago

As I know "grid_scales" is parameter that is added to calculate "Loss" for each grid. In other word, "grid_scales" penalize "Loss" for custom grid. Example: grid_scales = [1,1,1] mean we penalize "loss" of 3 grid [13,13] [26,26], [52,52] is same and equal "loss" which is calculated grid_scales = [2,1,1] mean we penalize "loss" of grid [13,13] > grid [26,26] and [52,52]. here we focus more on "loss" of large object. grid_scales = [1,1,2] mean we penalize "loss" of grid [52,52] > grid [26,26] and [13,13]. here we focus more on "loss" of small object.