fann
fann copied to clipboard
How load and train again in C
Hello, I found example on http://leenissen.dk/fann/wp/help/getting-started/ is possible to show (meybe add to example directory) how load network and learn it again? For example in C
fann_load(file)
fann_train(error)
fann_save(file) /* again */
Hi @mikolaj24,
your rough draft already is pretty close to reality. In C, it would look roughly like this:
struct fann *my_ann = fann_create_from_file("ann_file.net");
if (!my_ann) {
fprintf(stderr, "error while loading file");
return;
}
fann_train_on_file(my_ann, "training.dat", 1000, 100, 1e-6f);
int result = fann_save(my_ann, "ann_file.net");
if (result < 0) {
fprintf(stderr, "error while saving file");
}
fann_destroy(my_ann);
Does this answer your question?