recasens / Saliency-Sampler

The saliency-based is a distortion layer for convolutional neural networks that helps to improve the spatial sampling of input data for a given task.
163 stars 23 forks source link

Is p just to control the pretraining blur? #4

Closed micimize closed 4 years ago

micimize commented 4 years ago

As far as I can tell this could all be

 add_pretraining_blur = epoch <= N_pretraining
...
 output,image_output,hm = model(input_var,add_pretraining_blur) 
...
 if add_pretraining_blur: 

We found helpful to blur the resampled input image of the task network for some epochs at the beginning of the training procedure. It forces the saliency sampler to zoom deeper into the image in order to further magnify small details otherwise destroyed by the consequent blur. This is beneficial even for the final performance of the model with the blur removed.

https://github.com/recasens/Saliency-Sampler/blob/0557addd00c9592f3f6c1be6e37583e9132e4eba/main.py#L193-L196 https://github.com/recasens/Saliency-Sampler/blob/0557addd00c9592f3f6c1be6e37583e9132e4eba/main.py#L199 https://github.com/recasens/Saliency-Sampler/blob/0557addd00c9592f3f6c1be6e37583e9132e4eba/saliency_sampler.py#L117-L120

recasens commented 4 years ago

Hi!

Yes, p was added as to provide more flexibility to the code, but at the end was just used as a binary flag to control the pretraining blur.

Sorry for the confusion!

micimize commented 4 years ago

Thanks!