Set a ANN_MLP as trained
Hello,
We are using ANN_MLP in a special way. We train a ANN_MLP and we save the network configuration in a .hpp file. Then we need to load the network configuration. We can not use the load function. Therefore we have to set the weight using getWeights() like that:
cv::Mat((128+1) , 100, CV_64F, WEIGHTS_01 ).copyTo(getWeights(1));
Is that correct?
We also need to set the attribut trained to True. We not find the way to do that. Do you know how to do that?
Thank you,
about : cv::Mat((128+1) , 100, CV_64F, WEIGHTS_01 ).copyTo(getWeights(1));
it is not correct but it works!
How to set trained to true? Trained your network with 1 iteration and updatWeighte or save your network in temporary yml file and reload it
or make a PR
we train the network then we put the weights in a static array in a hpp. Above WEIGHTS_01 is a static array. What do you mean by: "it is not correct but it works" ?
Method is getWeights and not setWeights. Usually there is a get and set method
But not in the ANN_MLP class of opencv: you can not set the weight is there a reason for that? I am using still opencv 3...
so, what you want, is not builtin (though it makes some sense)
maybe you can add a
setWeights(vector<Mat>)
function, that:trained
flag