cszn / FFDNet

FFDNet: Toward a Fast and Flexible Solution for CNN based Image Denoising (TIP, 2018)
https://ieeexplore.ieee.org/abstract/document/8365806/
469 stars 130 forks source link

Logic while training FFDNET #22

Open AnasShahzad1996 opened 5 years ago

AnasShahzad1996 commented 5 years ago

In your file model_train.m, you multiply the sigmas with an array of random numbers. Since randn produces negative numbers such as -3.14, the sigma will exceed 75 in the image. My question is that why do you multiply the sigmas with that array

K = randi(8); labels = imdb.HRlabels(:,:,:,batch); labels = data_augmentation(labels,K); sigma_max = 75; sigmas = (rand(1,size(labels,4))*sigma_max)/255; <-------------- This line! ------------------> new_arr = bsxfun(@times,randn(size(labels)), reshape(sigmas,[1,1,1,size(labels,4)])); inputs = labels + new_arr;