In the GAN notebook, generated images have the undesired effect of #112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bright, single-colored pots. I happened to realize that it is not
entirely due to GAN itself (if at all), but to the way we convert
it to PIL images and plot it afterwards. This is due to the fact that
the final layer of the generator model uses tanh activation, which
results in neuron output in the range of [-1, 1], unlike real_images,
which are in [0, 1]. So I find it best to leave, for the lines of
code involving image.array_to_img() [I believe there are only three],
leave real_images part unchanged, and modify generated_images part to
sth like:
image.array_to_img(generated_images[i], scale=True).
This will remove the above-mentioned undesired effect.
The reason is that the [-1, 0] part of [-1, 1] when multiplied by
255 and then converted to unit8 will have unexpected color behaviour.
(The negative values will circle periodically back like in Z_256)
Actually, the training process and hyperparameters of the optimizers
can also be altered accordingly if we have the generator output's range
be consistent with the real images range and train.