Sei sulla pagina 1di 4

A INTRODUCTION TO ARTIFICIAL NEURAL NETWORK

LIBRARY IN C++

Artificial Neural Network is a robust way to recognise image edges very


deeply. As its has many types such as Vanilla NN , Recurrent NN , LongShort
term NN. And Convolutional NN.As these neural networks possesses very deep
approach like learning rate , bias , momentum , topology , weight matrices ,
neurons , and many more.For a beginner it’s a very difficult process to understand.
So as a innovative budding engineer ,I think that if I may create a library which
hides all the implementations details of the neural network, and shows only the
basic details like how exactly big or small topology is needed for a Convolutional
Neural Network . And all the other typical information like weight
matrices(randomly generated , generation of layers , assigning values to neurons ,
and many more things or stuff).

So basically I tried to create a Neural network library after which as a result . If a


user simply link my library to his/her code ,then it might takes only 5 to 6 minutes
to create a user defined Neural Network(Initially Convolutional one).

A Vanilla NN Diagram
Hidden
neuron weight
neuron
s
Example :- For training a neural network

1 #include <vector>

2 #include “NeuralNetwork.hpp”

3 using namespace std;

4 int main()

5 { vector<int> topology(3);

6 for(int i =0 ; i < topology.size(); i++){

7 topology.push_back(3); }

8 NeuralNetwork nn = new NeuralNetwork(topology);

9 vector<double> input(3) , target(3);

10 for(int i =0 ; i < input.size(); i++){

11 input.push_back(3); }

12 for(int i =0 ; i < target.size(); i++){

13 target.push_back(3); }

14 nn->train(input , target , learningRate , Bias);

15 return 0; }
Example :- For classify test data

1 #include <vector>

2 #include “NeuralNetwork.hpp”

3 using namespace std;

4 int main()

5 { vector<int> topology(3);

6 for(int i =0 ; i < topology.size(); i++){

7 topology.push_back(3); }

8 NeuralNetwork nn = new NeuralNetwork(topology);

9 vector<double> input(3) , target(3);

10 for(int i =0 ; i < input.size(); i++){

11 input.push_back(3); }

12 nn->classify(input);

13 return 0; }
Conclusion

As per the above code training data may take only 15 lines of code to learn a
machine for a particular dataset. And only 13 lines to classify test data.

Click here to check progress in source code

THANK YOU

Potrebbero piacerti anche