void fann_train_on_data_callback(struct fann * ann, struct fann_train_data * data, unsigned int max_epochs, unsigned int epochs_between_reports, float desired_error, int (*callback)(unsigned int epochs, float error));
Trains ann using data until desired_error is reached, or until max_epochs is surpassed.
This function behaves identically to
fann_train_on_data
, except that
fann_train_on_data_callback
allows you to specify a function to be called every
epochs_between_reportsinstead of using the default reporting mechanism.
If the callback function returns -1 the training will terminate.
The callback function is very useful in GUI applications or in other applications which do not wish to report the progress on standard output. Furthermore the callback function can be used to stop the training at non standard stop criteria (see Training and Testing.)
This function appears in FANN >= 1.0.5.
The training algorithm used by this function is chosen by the
fann_set_training_algorithm
function. The default training algorithm is FANN_TRAIN_RPROP
.