1 | initial version |
sure, you can!
CvANN_MLP mlp ;
mlp.train ( trainingData , trainingClasses );
// now save it:
cv::FileStorage fs("mlp.yml", cv::FileStorage::WRITE);
mlp.write(*fs, "mlp");
later:
CvANN_MLP mlp ;
// read it back:
mlp.load("mlp.yml","mlp");
// now you can run your prediction as usual
2 | No.2 Revision |
sure, you can!
CvANN_MLP mlp ;
mlp.train ( trainingData , trainingClasses );
// now save it:
cv::FileStorage fs("mlp.yml", cv::FileStorage::WRITE);
mlp.write(*fs, "mlp");
"ann");
// "ann" is the name of the node here, you can choose anything you like,
// as long as it's consistent with the one below, when reading
later:
CvANN_MLP mlp ;
// read it back:
mlp.load("mlp.yml","mlp");
mlp.load("mlp.yml","ann");
// now you can run your prediction as usual