Neural Strokes

This is a mostly failed experiment that I've been carrying during a train ride, my goal was to teach a neural network to draw strokes in an appropriate way.
This might be somehow related to the idea of stroke based rendering.

I tried to make diagrams to explain what I was aiming at.

During the training phase:

During the generation phase:

As usual I implemented this in possibly one of the least suited environment for this task, java/processing.
Source code here.

It doesn't work as expected but can still generate some funny, often colorful, pictures.

Side by side comparison...

I've only spent a couple hours on this so I'll possibly try to rework it later at some point.