complete cythonized mlp (neural network) code for classification or regression