epistemophiliac
epistemophiliac

Reputation: 869

Neural Network Weights in OpenCV 3

How do you apply weights in OpenCV 3 with the C++ ml.hpp library? I'm aware previously with the CvANN_MLP objects weights could be applied as follows:

mlp.train(trainData, trainClasses, weights);

However since CvANN_MLP has been depreciated, I can't seem to find documentation on how to apply predefined weights.

Upvotes: 1

Views: 170

Answers (1)

epistemophiliac
epistemophiliac

Reputation: 869

Just figured it out.

Ptr<TrainData> MLPdata = TrainData::create(trainingData, ROW_SAMPLE, trainingClasses, noArray(), noArray(), weights);
mlp->train(MLPdata);

Check out this document for more.

Upvotes: 1

Related Questions