Neural Network that is developed in plain C++ to be able to represent a black-box model of a logic gate given to it by training it.
- MISS knowledge
- What does it do?
- Table of operations
- Examples
- More in-depth knowledge
- Activator transfer function
- Usage
- Credits
Thanking the MISS class from College (Modeling and simulation of systems), we have understood how a Neural Network works. Here that knowledge, alongside OOP concepts is used to showcase a prototype of a black-box model of a neural network.
The program is designated to use inputs (std::vector
of inputs). Inputs used here are a 3d vector, a matrix, of std::vector
(s). The inputs are stored and sent to the neural network, where they are processed. The output is a vector of results.
A | B | A ^ B | A | B | A & B |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
0 | 1 | 1 | 1 | 0 |
1 | 0 | 1 | 1 | 0 |
1 | 1 | 0 | 1 | 1 |
The neural network used is a fully-connected
, feed-forward
neural network. All nodes (neurons) are connected with every neuron in the next (previous) layer.
The method used for sending data is a feed-forward
method. Feedforward is the reverse exercise of feedback. It's the process of replacing positive or negative feedback with future-oriented solutions. In simple terms, it means focusing on the future instead of the past.
The method used for training the neural network, is data-propagation
method.
Backpropagation, or backward propagation of errors, is an algorithm that is designed to test for errors working back from output nodes to input nodes.
Transfer function used for this neural network is f(x) = tanh(x)
. The derivative is f'(x) = 1 - tanh^2(x)
which can be approximated to g(x) = 1 - x^2
for these values.
git clone https://github.com/NenadGvozdenac/Logic-Gate-Neural-Network
$ g++ NeuralNetwork/Application/main.cpp -o NeuralNetwork/Application/Program
$ ./NeuralNetwork/Application/Program.exe
You can add an additional parameter after the .exe
, indicating a number of tests.
For example: $ ./NeuralNetwork/Application/Program.exe 20000
.
Abhishek Pandey - tutorial for Neural network