Is the code on line 23 in the main_train.py file[DnCNN-keras] correct?
wangweiwei104 opened this issue · 6 comments
noise = np.random.normal(0, args.sigma / 255.0, batch_x.shape) # noise
batch_y = batch_x + noise
yield batch_y, batch_x
Does these lines of code mean that the labels are clean pictures rather than noises?
However, in the paper 'Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising ', the noise are set as labels.
Is the code correct?
You should see the training file. He gets it correctly but just inverses the index.
Here the main_train.py, line 162.
The index is [1] then [0]
batch_x, batch_y = batch_yx[1].cuda(), batch_yx[0].cuda()
@ngcthuong Thank you for your reply, but there are no 162 lines in the main_train.py file. I didn't find this code.
batch_x, batch_y = batch_yx[1].cuda(), batch_yx[0].cuda()
@ngcthuong I am referring to the keras version rather than pytorch here !
The network output is still noise, the only difference is the author subtracts noise from inputs to get the estimated clean image, as you can see in line 76:
x = Subtract(name = 'subtract' + str(layer_count))([inpt, x]) # input - noise
Actually there are no difference, since the idea of residual still resides here.
The network output is still noise, the only difference is the author subtracts noise from inputs to get the estimated clean image, as you can see in line 76:
x = Subtract(name = 'subtract' + str(layer_count))([inpt, x]) # input - noise
Actually there are no difference, since the idea of residual still resides here.
ok, I got it! Thanks! @bittergourd1224