I am trying to implement Neural network with OpenCV ANN Library. I had a working solution, but after upgrading to OpenCV 3.1 it stopped working. So I created a simplified co
OK, after a while of trying possible combinations I found a solution.
Activation function must be set after setting layer sizes. I dont know exactly why, but when I flip rows like this
nn->setLayerSizes(layers);
nn->setActivationFunction(cv::ml::ANN_MLP::SIGMOID_SYM);
its working. If someone knows the reason of this, please tell me.