Closed Nikronic closed 5 years ago
Tensorboad graph visualization is same as the provided shape in U-Net paper. Gradients are not checked yet.
RandomNoise
layer is making images too noisy! Here is an example:
Normalization
makes images noisy a little bit. Here is an example:
And here is an example without normalization and random noise:
Here are trained outputs with default parameters for 20 epochs:
Without Normalization
and RandomNoise
:
Without Normalization
and with RandomNoise
:
With Normalization
and RandomNoise
:
Note: Halftone effects applied randomly, so with every run we get different images.
RandomNoise
implementation is wrong. Check implementation in DeepHalftone
repository.'
Please see commit https://github.com/Nikronic/CoarseNet/commit/2be8962eddccfb35ef9c04589f67958777753651
std = 0.007
has been chosen RandomNoise
class. You can achieve it by 0.1/128
division. 0.1
is the value proposed in the paper and 128
is the normalization term. Actually, 0.1
is a std
value for images in range [0, 255]
, but in Pytorch, images are between [0,1]
and then we standardizing them between [-1, 1]
, So we have to divide it by 128
.
Normalization is the reason we see creepy images even after loading images from the dataset, So the outputs should be more creepy!
You can see the abstract solution in this post: https://discuss.pytorch.org/t/understanding-transform-normalize/21730/18 And the similar question posted here: https://discuss.pytorch.org/t/understanding-transform-normalize/21730/17
std = 0.007
has been chosenRandomNoise
class. You can achieve it by0.1/128
division.0.1
is the value proposed in the paper and128
is the normalization term. Actually,0.1
is astd
value for images in range[0, 255]
, but in Pytorch, images are between[0,1]
and then we standardizing them between[-1, 1]
, So we have to divide it by128
.
std=0.1
is THE CORRECT ONE.
Unnormalization can solve the issue.
After unnormalizing, here is the sample output:
It no longer genrates noise but still far from desired output because it is not working effectively as described as a low-pass filter. Obviously we can see halftone patterns in image.
We track this issue in a separate issue #10
I tried to overfit model on a simple and small dataset, but I got very noisy output. I tried to change target to edge detection using Canny edges as ground truth, but I sill have noisy output.
I am stuck right now and I tried to debug using TensorboardX but it has issues (I made one in their repository). So plan is to implement my model using Tensorflow and try to debug it using tensorboard and convert the final model to Pytorch.
Note: I also tried Visdom by FacebookResearch but they do not provide any API to demonstrate graph states.