The people generated by the ASIC device do not exist. They are synthetic creations of the Generative Adversarial Network.
Over the last few years many will know I’ve been engaged in researches into blockchain. Particularly Ravencoin X16R,X16RV2 and KAWPOW, as well as the many blockchain explorers/trackers/scanners that I have written.
Recently I’ve become a little bit obsessed with GAN, a recently invented class of machine learning frameworks designed by Ian Goodfellow and his colleagues in 2014 and his colleagues at Nvidia. Two neural networks contest with each other in a game (in the form of a zero-sum game, where one agent’s gain is another agent’s loss).
Naturally, using modern GPU power that has traditionally been used for physics simulations, gaming, computational problems and things like cryptocurrency mining, it was a novel idea to consider that such technology could be used to create new novel data. Or be a fundamental resource of great power and adversarial adaptation in the playing of the game.
I was very impressed at deepfakes, and the speed that deeplearning, machine learning and other technology has grown, and although I was generally disinterested by early A.I, such as “ALICE” and other polymorphic approaches to computer programming, I was particularly captivated by the deeplearning of Nvidia’s GAN. It appeared that through the correct processing of image boundaries of a very huge amount of “data”, a neural network, much like Data’s in startrek, really was capable of producing extremely novel applications in science and technology. For example, there is no reason why a similar approach could not be used to improve designs, or even build an entire product from start to finish without any human intervention. It certainly would seem then the cosmic idea of a “universal constructor”, first introduced in the popular game “Deus Ex”, is not such a strange idea. Certainly not when it is possible to apply the same methodology for face mixing and latent tracing as with Nvidia GAN, to chemical structures. Theoretically a machine that conceive an indefinite number of combinations, but can also discriminatingly qualify them in a similar way to a human being. An impressive feat.
Predicting the Beginning and the End
To those that worry, about the technology for the future that will destroy human ingenuity and practicality – I think that the transformative power, and capability of GAN and technology like it, should allow us to create self improving machines that soon will become our guardians of the earth and the extended galaxy. A far fetched idea to some, but this technology makes it seem inevitable to me.
It may not be very soon, but from what I can see already and imagine, the possibilities for this technology are truly endless, and it will likely be used, it may very well be used for exploring the universe from home. This technology is so simple at present, that the more complex forms of it’s application, theoretically could create entire universes, and with the sufficient compute and energy, it might be possible to discover many things about our universe without actually studying them. Simply provide a few simple rules, and the rest can be generated. Theoretically, anyway. Perhaps, then, we might be nearing a real explanation for the Hawkings Paradox, perhaps some thermal dynamic problems such as the total energy available at the beginning of the universe can be solved in a similar way through GAN type neural compute from data presently at the “middle” and latent images of stars very distant in the “beginning” or past (it takes a long time for light to reach the planet earth so most cosmic light is ancient). Using this data a new type of fundamental GAN that doesn’t just shape engineering, and novel artistic insight or design, or some chemistry simulation, but it may indeed allow us to predict nearly all things, and create a new type of computer system that is quite different from the one we are familiar.
When we mix the trained GAN Model generations we get new sets of variations;
A new Computer System
This new computer system would, theoretically, make efficiencies everywhere where we do not. Such as the adequate and measurable metric or data storage, redundancy, and things like satellite imagery and weather reporting. The neutral net device should theoretically be linkable to human consciousness, and to a greater system and create a new type of VR highway, that I predict will one day exist, optimizing many frequent challenges of modern society, that, until about 30-40 years ago, did not exist, until the abundance of data came along. GAN is a result of the abundance of data, but perhaps certain fundamental societal and technological evolutions in civilisation. Technology like GAN and blockchain might just be an inevitable byproduct or endproduct, of more data than we can humanly handle. And finding a way to use the data we have more efficiently, and to track it properly with automation, (such as with cloud compute), this is key. Really – the secret mystical understanding of the future of technology – was based on the understanding of the derivation of technology, society, and art, and the manner in which humanity interacts with that over a period of time. This reveals how science and art, and the society that practices it must change, rather than that the change applies to society, the society very much applies to the change.
Creating the Neural Network on Nvidia/CUDA
Creating the network is simple enough to do, and this can be done without a Docker Container on what I’d recommend would be an Ubuntu 20.04 LTS system. You can also use a docker container, however a Ubuntu 20.04 LTS system with the reference Nvidia drivers and a venv environment should be sufficient for our needs. It’s worth noting that if you intend to use the latest version of torch, python 3.8 is incompatible with torch v2, and I had some difficulty installing v1 on my linux system, simply because I was running python 3.8. It should work OK if you have a venv with python 3.7 or similar. Because this configuration can break a lot of things. It is highly recommended to use either Docker or venv, or both or either to achieve this.
Installing and Preparing the Datasets
#install venv sudo apt-get install python3-pip # do not do this as root, create a user for it [or use your regular user] adduser someuser virtualenv venv -p python3 # active venv (must be done where venv created) source venv/bin/activate # clone my repo git clone https://github.com/ravenlandpush/sbgan # cd to repo and download the celeba dataset # (http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html ) cd sbgan python helper.py # Prepare the JPEG data (--out datasetout pathtosearchsubdirsforimages) python prepare_data.py --out data .
# install the necessary dependencies (note that torchvision 2 should be OK) I use it OK for this and you can skip requiring 1.x for this example pip install torch pillow tqdm torchvision lmdb # CUDA package names for thoroughness shouldnt be necessary if you've 3rd party nvidia drivers installed by Ubuntu 20.04 LTS. # DANGEROUS step if you don't know what your doing # apt-get install nvidia-cuda-dev nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc # Start Training the Deeplearning Generative Adversarial Network with your dataset python3 train.py --mixing /home/adam/GAN/sbgan/data
Congratulations! You’ve reached this far and your GAN is now training. You’ll notice though that it’s running probably quite slowly. For really decent performance you’ll want to have a number of GPU. I’d recommend running on Amazon were it not so expensive. You can get multiple GPU systems though between $8 and $15 an hour, so, relatively that’s not bad considering Tesla P100 gpu’s can set you back thousands a piece. For those that mean business, and for the many that work on GAN more full time they seem to be using DGX-1 which have 6 or 9 GPU builtin and are very small. Unfortunately they cost about $129,000. Although it’s still quite a specialist field, it reminds me of where bigdata was 15-20 years ago. The same could be said for enterprise linux.
Things do change. The last steps now after many weeks would be to run against the models that your generating.
Generating from Modelling
Once your GAN has been “trained”, it should be possible to generate some really amazing mixers of images and I was taken aback by how effective some of the software of modernity has become at identifying things, even when the software does not know what it is, detecting the boundary and “putting things in the right place” is all that matters to us.. very cool.
# Generate from the Trained Models created in checkpoint folder (happens as training goes by) # Use size 8,16,32,64,128,256,512,1024, etc # depending how far along the training python3 generate.py /home/adam/GAN/sbgan/checkpoint/train_step-4.model --size 64 --n_row 8 --n_col 8 python3 generate.py /home/adam/GAN/sbgan/checkpoint/train_step-4.model --size 64 --n_row 8 --n_col 8
The Final results
I really love GAN’s now 😀
Just for fun I wrote this script that can automatically pull data in and out of a docker container.
#!/bin/bash # this script indefinitely makes a new face every x moments # deep fake y'all nvidia cuda stylee length=1000000 for (( i = 0; i <= $length; i=i+4 )) ; do j=$(($i + 1)) k=$(($j + 1)) l=$(($k + 1)) echo "Processing face $i,$j,$k,$l"; docker run --gpus all -it --rm -v `pwd`:/scratch --user $(id -u):$(id -g) stylegan2ada:latest bash -c "(cd /scratch && DNNLIB_CACHE_DIR=/scratch/.cache python3 generate.py --trunc=1 --seeds=$i,$j,$k,$l --outdir=out --network=https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada/pretrained/metfaces.pkl)" > /dev/null sleep 10 done
Simple but, cool. meh. As you can see this one uses the stylegan2-ada pretained metfaces pkl model from nvlabs. Not bad for a quick poke around at a new subject.