I am now using FANN to do incremental learning. Would anyone let me know whether my program is wrong or not? Thank you.
I have a data set to train. But in future I will get some new data set. I wanna incrementally train the current nn with the new data set, called "incremental learning".
I firstly create and train a nn with old data "old.data". I also set the training algorithm.
struct fann *ann = fann_create_standard(num_layers, num_input, num_neurons_hidden, num_output); fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC); fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
fann_set_training_algorithm(ann, FANN_TRAIN_INCREMENTAL);
fann_train_on_file(ann, "old.data", max_epochs, epochs_between_reports, desired_error); fann_save(ann, "mynn.net");
fann_destroy(ann);
Then when I have new data set "new.data", I think I can program like this:
struct fann *ann = fann_create_from_file("mynn.net");
fann_train_on_file(ann, "new.data", max_epochs, epochs_between_reports, desired_error);
Is my program correct?