How to save ANN_MLP by appending to file containing other data?
I'm using OpenCV 3.2. I need to save a trained ANN_MLP network, but it needs to be saved in the same file as other serialised data from the application (the api specifies only one set-up file), so I need a save() method that appends to existing data in a file.
Is there a way to save ANN_MLP by appending to an existing file and then read it back again?
Failing that, is is possible to "train" a network by setting the weight matrices, instead of using train() or load()? This would enable me to simply write/read the matrices that describe the network.
I have solved the second part of this question: it is possible to create a working network by copying the matrices. The tricky part is that there is no setWeights() method, so you have to copy the weights using:
mlp->getWeights(i).copyTo(mlp2->getWeights(i));
Only copyTo() will actually copy to the internal data of mlp2; assignment and clone() will not work.
this is the "back door".
what if you use
to save it, and
to retrieve it ?