This is a C++ implement of simple neural network. It's based on video Neural Net in C++ Tutorial by David Miller.
1 Gernerate training data to slove XOR problem
g++ ./makeTrainingSamples.cpp -o makeTrainingSamples
./makeTrainingSamples > out.txt
2 Test neural netwrok
g++ ./neural-net.cpp -o neural-net
./neural-net
And you will get the result!
Let the neural net output its results to a file instead:
./neural-net > results.txt
Use python to plot iteration number vs recent average error:
python3 plot_simulation_results.py
Lets say we estimate the surface:
given:
then
Which is basically cylindrically symmetric a cosine-ish function near the origin and flat outside the radius
First attempt gave: Which was not really that nice.
Although comparing with the training gave quite a good score in terms of error... Lets compare with the training set:
This suggested that the training set was actually wrong! Looking back I found that i used
Correcting the training set gives: