Implementing an Artificial Neural Network from scratch using C++
There are two implementations listed here:
-
A basic_ann without using any libraries, just raw C++. The main function here is to train the network to act as a 3-input XOR operator.
-
A vectorized implementation of an ANN (include this header) using the ArrayFire library that allows the use of an unified source-code to compile programs for CPU, CUDA, as well as OpenCL. Some features that allow for smooth experimentation:
- Ability to add custom activation functions using the
Layer::setNewActivation
function, as shown here. - Decaying learning rate across epochs as shown here, by defining a custom
calc_LRdecay
function.
- Ability to add custom activation functions using the
- Implementation of XOR gate with loss-values.
- Using the ANN to classify NLTK Movie-Reviews as postive or negative, by using TFIDF transform for feature description. repo