Ask Your Question
0

Neural network training in C usage in C++ is possible?

asked 2013-02-23 10:22:51 -0600

updated 2013-02-23 10:27:20 -0600

rics gravatar image

what happen to trained Neural network implemented in c with opencv if execution of program is over? can we use same trained network again if we run that code again ? if not... how can we do that ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-02-23 11:27:21 -0600

berak gravatar image

updated 2013-02-23 11:30:55 -0600

sure, you can!

CvANN_MLP mlp ;
mlp.train ( trainingData , trainingClasses );
// now save it:
cv::FileStorage fs("mlp.yml", cv::FileStorage::WRITE);
mlp.write(*fs, "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","ann");
// now you can run your prediction as usual
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-02-23 10:22:51 -0600

Seen: 600 times

Last updated: Feb 23 '13