Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is a basic code C++ to solve the XOR problem using ANN_MLP:

https://github.com/sjhalayka/opencv_xor/blob/master/main.cpp

Here is the source code that performs the setLayerSizes function:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L309

So it looks there is no set maximum number of layers, nor is there a maximum for each layer -- it's only what your RAM can handle.

Here is a basic code C++ to solve the XOR problem using ANN_MLP:

https://github.com/sjhalayka/opencv_xor/blob/master/main.cpp

Here is the source code that performs the setLayerSizes function:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L309

So it looks there is no set maximum number of layers, nor is there a maximum for each layer -- it's only what your RAM can handle.

Here is the source code that performs setTermCriteria:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L158

It looks like the maximum number of training sessions is 1000:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L849

Here is a basic code C++ to solve the XOR problem using ANN_MLP:

https://github.com/sjhalayka/opencv_xor/blob/master/main.cpp

Here is the source code that performs the setLayerSizes function:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L309

So it looks there is no set maximum number of layers, nor is there a maximum number of neurons for each layer -- it's only what your RAM can handle.

Here is the source code that performs setTermCriteria:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L158

It looks like the maximum number of training sessions is 1000:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L849

Here is a basic code C++ to solve the XOR problem using ANN_MLP:

https://github.com/sjhalayka/opencv_xor/blob/master/main.cpp

Here is the source code that performs the setLayerSizes function:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L309

So it looks there is no set maximum number of layers, nor is there a set maximum number of neurons for each layer -- it's only what your RAM can handle.

Here is the source code that performs setTermCriteria:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L158

It looks like the maximum number of training sessions is 1000:

https://github.com/opencv/opencv/blob/9787ab598b6609a6ca6652a12441d741cb15f695/modules/ml/src/ann_mlp.cpp#L849