Ask Your Question
0

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

asked Feb 23 '13

updated Feb 23 '13

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 ?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered Feb 23 '13

berak gravatar image

updated Feb 23 '13

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
Preview: (hide)

Question Tools

Stats

Asked: Feb 23 '13

Seen: 609 times

Last updated: Feb 23 '13