Reputation: 869
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
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