A tiny C script that generates cool neural net random art.
it’s a CPPN (Compositional Pattern Producing Network)(Apparently, I don't actually know if this is true, I am too lazy to check, I generated readme using gemini), it basically does this for every single pixel:
- "yo math, here is a coordinate (x, y) and the current time." <- AAHHAHAHAH, shoutout gemini
- the neural net does some random math
$(\tanh, \sin, \text{etc.})$ - it spits out an RGB value.
- we paint the pixel.
since neural nets are basically just big continuous functions, the output looks like organic trippy soup instead of random noise.
If you don't want to compile this right now, check out the demos/ folder. It has a few recordings of what this thing actually spits out.
- check if you have
gccandffmpeg. - Make sure you have a video player like
mpvorvlcinstalled, otherwise the script will finish but nothing will pop up. - run the magic script:
chmod +x run.sh ./run.sh
I don't really have much to say to be honest, so here are random videos that made me think of this: