Simple std-style library for training Neural Networks
Addition to synapse.h, gives you ability to render display your training results in GUI using raylib
You will need to install locally this packages:
- raylib.h
- build-essentials
In the demos folder you can find a few demos that uses synapse.h and gym.h
Trains NN that classifies shapes. It trained to distinguish rectangles and circles
In the right top corner there is drawable canvas, where you can make a shape and NN will try to figure out what shape it is
Also you can press "Q" or "W" to generate cirle or rectangle on this canvas
Example compile options:
#!/bin/sh
exec=shape
gcc -o build/$exec demos/$exec.c -O3 -Wall -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
./build/$exec
Trains NN that tris to simulate two images
When you run compiled programm your give two images as input parameters and it trains NN to simulate first image if state parameter is 0 and second if parameter is 1.
So this gives you ability to look into what is between these two states. When you will change state parameter with given slider your will see smooth transition from one image to another.
After build you will see graphical window with:
- Cost function plot
- Representation of current state of neural network's weights as a heatmap
- Current ability of neural network to upscale given image and below it slider to change state parameter from 0 to 1.
- Slider at the top to change learning rate
#!/bin/sh
exec=img2nn
gcc -o build/$exec demos/$exec.c -O3 -Wall -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
./build/$exec mnist/8.png mnist/6.png