fann icon indicating copy to clipboard operation
fann copied to clipboard

How load and train again in C

Open mikolaj24 opened this issue 9 years ago • 1 comments

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 */

mikolaj24 avatar Nov 08 '16 10:11 mikolaj24

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?

broken-pen avatar Jun 05 '18 20:06 broken-pen