Generic implementation of feedForward Neural Network