Newmu / dcgan_code

Deep Convolutional Generative Adversarial Networks
MIT License
3.42k stars 696 forks source link

binary data? #16

Open genekogan opened 8 years ago

genekogan commented 8 years ago

what is the best way to make this work effectively on binary data? i'm assuming the network won't learn to output binary on its own, even if all the inputs are binary. trivially you can just threshold each output value at 0.5, but is there a better way to do this? i'm hoping to take advantage of having only two states to get away with using a larger input vector.

dribnet commented 8 years ago

I think thresholding input at 0.5 to either 0.0 or 1.0 is sufficient and generally done. I'd expect output to quickly favor binary as anything else would tip of the discriminator. Main speed up would be making sure the architecture has 1 channel and not 3.

Newmu commented 8 years ago

Have you tried using sigmoid generator output instead? When you train a DCGAN on MNIST with sigmoid outputs it's pretty much always railed binary like you expect.

genekogan commented 8 years ago

thanks for the tips! relatedly -- is my intuition about using larger inputs incorrect? i.e. in the image examples, each element is an 8-bit int (0-255). if i use binary instead, is it fair to expect comparable performance for input vectors 8x the same size?