This is a small attempt to build a Neural Network Library for easy of use in c
This library has been developed by me , and is a crude attempt to program a neural net library in c
It has to be noted that the library has only online learning , with a constant learning rate learning
it can be used to make different neural net architectures, using very simple functions
the only thing that is left to the user is to define his/her own activation functions, although ELU, RELU, IDENTITY, TANH and LOGISTIC and LOGADAPT (my very own self define activation function), etc have been defined they can be added by declaring and defining them in activationfunctions.h and activationfunctions.c files
also another task that is left to the user is to defien their own cost function gradient, for their neural net
in my example logic.c i have used log cost function derivative defined as costgrad note : you need to define the gradient of the cost function you use not the cost function example i used -y*log(x) - (1-y)*log(1-x) so i defined its derivative in costgrad
Up to my knowledge ther have been no bugs notices, read the logic.c it can emulate small 2 bit logic functions if programmed i have the training set synthetically generated, in trainingsetlogic.txt
read the sample,
init_neuralnet -> you pass inputs regarding the architecture of the neuralnet to make it like the way you want
feedforward -> calculated output
update_costfunction_gradient -> update the loss gradient only for the last layer
backpropogate -> finds all weight derivatives and output error gradients at all level and adds current change to all all weight and bias change
update_weight -> updates the weight with changes generated by backpropogation
this functions have to be called in the same sequence as asked to
in the end delete the neural net
the vector files namely vector.h and vector.c are the files whose sources can be vectorized to get better performance but i lack GPU programming knowledge so is left up to someone to contribute untill then
If the PROJECT was in anyway usefull to you, do let me know with a treat