Several different parameters exists in an ANN, these parameters are given defaults in the fann library, but they can be adjusted at runtime. There is no sense in adjusting most of these parameters after the training, since it would invalidate the training, but it does make sense to adjust some of the parameters during training, as will be described in Training and Testing. Generally speaking, these are parameters that should be adjusted before training.
The training algorithm is one of the most important parameters. The default training algorithm is FANN_TRAIN_RPROP, but this may not always be the best choice. See fann_set_training_algorithm for more information about the different training algorithms.
The training algorithms have several different parameters which can be set. For FANN_TRAIN_INCREMENTAL, FANN_TRAIN_BATCH, FANN_TRAIN_QUICKPROP the most important parameter is the learning rate, but unfortunately this is also a parameter which is hard to find a reasonable default for. I (SN) have several times ended up using 0.7, but it is a good idea to test several different learning rates when training a network. It is also worth noting that the activation function has a profound effect on the optimal learning rate [Thimm and Fiesler, 1997]. The learning rate can be set by using the fann_set_learning_rate function.
The initial weights are random values between -0.1 and 0.1, if other weights are preferred, the weights can be altered by the fann_randomize_weights or fann_init_weights function.
In [Thimm and Fiesler, High-Order and Multilayer Perceptron Initialization, 1997], Thimm and Fiesler state that, “An (sic) fixed weight variance of 0.2, which corresponds to a weight range of [-0.77, 0.77], gave the best mean performance for all the applications tested in this study. This performance is similar or better as compared to those of the other weight initialization methods.”
The standard activation function is the sigmoid activation function, but it is also possible to use other functions. A list of the currently available activation functions is available in the fann_activationfunc_enum section. The activation function can be set for a single neuron using the fann_set_activation_function function and for a group of neurons by the fann_set_activation_function_hidden and the fann_set_activation_function_output functions. Likewise the steepness parameter used in the activation function can be adjusted with the fann_set_activation_steepness function.
FANN distinguishes between the hidden layers and the output layer, to allow more flexibility. This is especially a good idea for users wanting discrete output from the network, since they can set the activation function for the output to threshold. Please note, that it is not possible to train a network when using the threshold activation function, due to the fact, that it is not differentiable.