Errors from the fann library are usually reported on stderr. It is however possible to redirect these error messages to a file, or completely ignore them by the fann_set_error_log function.
It is also possible to inspect the last error message by using the fann_get_errno and fann_get_errstr functions.
FANN Error Handling | Errors from the fann library are usually reported on stderr. |
fann_errno_enum | Used to define error events on struct fann and struct fann_train_data. |
Error Handling | |
fann_set_error_log | Change where errors are logged to. |
fann_get_errno | Returns the last error number. |
fann_reset_errno | Resets the last error number. |
fann_reset_errstr | Resets the last error string. |
fann_get_errstr | Returns the last errstr. |
fann_print_error | Prints the last error to stderr. |
Used to define error events on struct fann and struct fann_train_data.
fann_get_errno, fann_reset_errno, fann_get_errstr
FANN_E_NO_ERROR | No error |
FANN_E_CANT_OPEN_CONFIG_R | Unable to open configuration file for reading |
FANN_E_CANT_OPEN_CONFIG_W | Unable to open configuration file for writing |
FANN_E_WRONG_CONFIG_VERSION | Wrong version of configuration file |
FANN_E_CANT_READ_CONFIG | Error reading info from configuration file |
FANN_E_CANT_READ_NEURON | Error reading neuron info from configuration file |
FANN_E_CANT_READ_CONNECTIONS | Error reading connections from configuration file |
FANN_E_WRONG_NUM_CONNECTIONS | Number of connections not equal to the number expected |
FANN_E_CANT_OPEN_TD_W | Unable to open train data file for writing |
FANN_E_CANT_OPEN_TD_R | Unable to open train data file for reading |
FANN_E_CANT_READ_TD | Error reading training data from file |
FANN_E_CANT_ALLOCATE_MEM | Unable to allocate memory |
FANN_E_CANT_TRAIN_ACTIVATION | Unable to train with the selected activation function |
FANN_E_CANT_USE_ACTIVATION | Unable to use the selected activation function |
FANN_E_TRAIN_DATA_MISMATCH | Irreconcilable differences between two struct fann_train_data structures |
FANN_E_CANT_USE_TRAIN_ALG | Unable to use the selected training algorithm |
FANN_E_TRAIN_DATA_SUBSET | Trying to take subset which is not within the training set |
FANN_E_INDEX_OUT_OF_BOUND | Index is out of bound |
FANN_E_SCALE_NOT_PRESENT | Scaling parameters not present |
FANN_E_INPUT_NO_MATCH | The number of input neurons in the ann and data don’t match |
FANN_E_OUTPUT_NO_MATCH | The number of output neurons in the ann and data don’t match |
FANN_E_WRONG_PARAMETERS_FOR_CREATE | The parameters for create_standard are wrong, either too few parameters provided or a negative/very high value provided |
FANN_EXTERNAL void FANN_API fann_set_error_log( struct fann_error * errdat, FILE * log_file )
Change where errors are logged to. Both struct fann and <struct fann_data> can be casted to struct fann_error, so this function can be used to set either of these.
If log_file is NULL, no errors will be printed.
If errdat is NULL, the default log will be set. The default log is the log used when creating struct fann and <struct fann_data>. This default log will also be the default for all new structs that are created.
The default behavior is to log them to stderr.
This function appears in FANN >= 1.1.0.
FANN_EXTERNAL enum fann_errno_enum FANN_API fann_get_errno( struct fann_error * errdat )
Returns the last error number.
fann_errno_enum, fann_reset_errno
This function appears in FANN >= 1.1.0.
FANN_EXTERNAL char *FANN_API fann_get_errstr( struct fann_error * errdat )
Returns the last errstr.
This function calls fann_reset_errno and fann_reset_errstr
This function appears in FANN >= 1.1.0.
The fast artificial neural network (fann) structure.
struct fann
Structure used to store data, for use with training.
struct fann_train_data
Change where errors are logged to.
FANN_EXTERNAL void FANN_API fann_set_error_log( struct fann_error * errdat, FILE * log_file )
Returns the last error number.
FANN_EXTERNAL enum fann_errno_enum FANN_API fann_get_errno( struct fann_error * errdat )
Resets the last error number.
FANN_EXTERNAL void FANN_API fann_reset_errno( struct fann_error * errdat )
Resets the last error string.
FANN_EXTERNAL void FANN_API fann_reset_errstr( struct fann_error * errdat )
Returns the last errstr.
FANN_EXTERNAL char *FANN_API fann_get_errstr( struct fann_error * errdat )
Prints the last error to stderr.
FANN_EXTERNAL void FANN_API fann_print_error( struct fann_error * errdat )
Structure used to store error-related information, both struct fann and struct fann_train_data can be casted to this type.
struct fann_error