slightly updated core of Lightweight Neural Network++ (http://lwneuralnetplus.sourceforge.net/)