The generator network we have implemented takes in a latent vector
Z of 2 elements only for this demo. The network is just a stack of fully-connected
tanh layers, like before. The depth and size of the network, and also the image resolution of the output can all be customised in the web app.
The best way to use this web app is to start with a low resolution for faster processing, of say around
160px. You can play around with different architecture configurations by hitting the
restart button, which will randomise all of the weights of the neural network and display the updated picture with the new settings.
Different colour modes are now supported. I have implemented Black and White, Red Green Blue, CMYK, HSV, and HSL colour models, so basically the output sigmoid layer of the neural network will correspond to one of these colour model layers. In addition, I have added the option to have an extra alpha-transparancy layer if we want to use an extra output to fill in the alpha channel.
After you are satisfied with the network architecture, you can also try to explore the latent space of the network by adjusting the latent vector
Z2 and hitting the
redraw button to see how the image changes. After you arrive at an image you like, if the resolution is too small during the trial and error phase, you can also increase the resolution, and hit the
redraw button to render the same image in larger size. The
save button will save the canvase into a
Try the web app demo here.
The implementation is currently not optimised, meaning that I query each pixel. It will be much faster to try to batch process the entire image, or even each line, rather than each pixel at a time. I have done such optimisations with Neurogram, but that was a much more intense project, rather than just an hour hack. If we try use WebGL to optimise matrix operations, we maybe able to perform near-realtime rendering in the future.
It should also be possible to export certain simple types of TensorFlow trained networks into JSON and get
recurrent.js to run those networks, given the somewhat similar computational graph nature of both libraries.