generic-github-user / xkcd-Generator

TensorFlow.js GAN for generating new xkcd comics
MIT License
4 stars 1 forks source link

Neural networks not training #8

Open generic-github-user opened 6 years ago

generic-github-user commented 6 years ago

Testing has confirmed that the discriminator network trains well; however, the generator network is almost impossible to train.

generic-github-user commented 6 years ago

Generator network does not actually train; loss value not changing when discriminator training function is disabled, even after discriminator network training.

generic-github-user commented 6 years ago

Generator network loss completely minimized when varList is disabled. Discriminator network is untrainable after this point.

generic-github-user commented 6 years ago

The discriminator network does train when its trainable variables (varList) are defined (and the generator network training function is disabled, to isolate loss value changes), unlike the generator network. This indicates that the trainable variables are correctly defined, so something else must be preventing the generator network from training.

generic-github-user commented 6 years ago

Labels for tf.losses.logLoss() function were placed as the second argument, instead of the first. Resolving this issue did not affect the performance of the training algorithm.

generic-github-user commented 6 years ago

Generator network now briefly training with discriminator network training disabled, but output values quickly explode:

Tensor
     [[9697017987072, 12064277921792, 0, ..., 0, 0, 10895708127232],]
Tensor
     [[0, 32100208082944, 0, ..., 0, 30390397960192, 26206128832512],]

The generator network likely tricks the discriminator network (which has not yet learned this characteristic of generated data) using arbitrarily large values.

generic-github-user commented 6 years ago

The discriminator network could also be overfitting and not generalizing, due to the low amount of training data.

generic-github-user commented 6 years ago

I think it's fixed. Decreased learning rate for adam optimizer used to train the generator network. Pixel levels are still inaccurate (dark images are generated, most training images are mostly white). Even when tested on one training image (to test copying of training data), this error still occurs.

Screenshot