International PHP Conference Berlin 2025

Costanti predefinite

Queste costanti sono definite da questa estensione e sono disponibili solo se l'estensione è stata compilata nel PHP o se è stata caricata dinamicamente a runtime.

Training algorithms
FANN_TRAIN_INCREMENTAL (int)
Standard backpropagation algorithm, where the weights are updated after each training pattern. This means that the weights are updated many times during a single epoch. For this reason some problems, will train very fast with this algorithm, while other more advanced problems will not train very well.
FANN_TRAIN_BATCH (int)
Standard backpropagation algorithm, where the weights are updated after calculating the mean square error for the whole training set. This means that the weights are only updated once during a epoch. For this reason some problems, will train slower with this algorithm. But since the mean square error is calculated more correctly than in incremental training, some problems will reach a better solutions with this algorithm.
FANN_TRAIN_RPROP (int)
A more advanced batch training algorithm which achieves good results for many problems. The RPROP training algorithm is adaptive, and does therefore not use the learning_rate. Some other parameters can however be set to change the way the RPROP algorithm works, but it is only recommended for users with insight in how the RPROP training algorithm works. The RPROP training algorithm is described by [Riedmiller and Braun, 1993], but the actual learning algorithm used here is the iRPROP- training algorithm which is described by [Igel and Husken, 2000] which is an variety of the standard RPROP training algorithm.
FANN_TRAIN_QUICKPROP (int)
A more advanced batch training algorithm which achieves good results for many problems. The quickprop training algorithm uses the learning_rate parameter along with other more advanced parameters, but it is only recommended to change these advanced parameters, for users with insight in how the quickprop training algorithm works. The quickprop training algorithm is described by [Fahlman, 1988].
FANN_TRAIN_SARPROP (int)
Even more advance training algorithm. Only for version 2.2
Activation functions
FANN_LINEAR (int)
Linear activation function.
FANN_THRESHOLD (int)
Threshold activation function.
FANN_THRESHOLD_SYMMETRIC (int)
Threshold activation function.
FANN_SIGMOID (int)
Sigmoid activation function.
FANN_SIGMOID_STEPWISE (int)
Stepwise linear approximation to sigmoid.
FANN_SIGMOID_SYMMETRIC (int)
Symmetric sigmoid activation function, aka. tanh.
FANN_SIGMOID_SYMMETRIC_STEPWISE (int)
Stepwise linear approximation to symmetric sigmoid
FANN_GAUSSIAN (int)
Gaussian activation function.
FANN_GAUSSIAN_SYMMETRIC (int)
Symmetric gaussian activation function.
FANN_GAUSSIAN_STEPWISE (int)
Stepwise gaussian activation function.
FANN_ELLIOT (int)
Fast (sigmoid like) activation function defined by David Elliott.
FANN_ELLIOT_SYMMETRIC (int)
Fast (symmetric sigmoid like) activation function defined by David Elliott.
FANN_LINEAR_PIECE (int)
Bounded linear activation function.
FANN_LINEAR_PIECE_SYMMETRIC (int)
Bounded linear activation function.
FANN_SIN_SYMMETRIC (int)
Periodical sinus activation function.
FANN_COS_SYMMETRIC (int)
Periodical cosinus activation function.
FANN_SIN (int)
Periodical sinus activation function.
FANN_COS (int)
Periodical cosinus activation function.
Error function used during training
FANN_ERRORFUNC_LINEAR (int)
Standard linear error function.
FANN_ERRORFUNC_TANH (int)
Tanh error function; usually better but may require a lower learning rate. This error function aggressively targets outputs that differ much from the desired, while not targeting outputs that only differ slightly. Not recommended for cascade or incremental training.
Stop criteria used during training
FANN_STOPFUNC_MSE (int)
Stop criteria is Mean Square Error (MSE) value.
FANN_STOPFUNC_BIT (int)
Stop criteria is number of bits that fail. The number of bits means the number of output neurons which differs more than the bit fail limit (see fann_get_bit_fail_limit, fann_set_bit_fail_limit). The bits are counted in all of the training data, so this number can be higher than the number of training data.
Definition of network types used by fann_get_network_type()
FANN_NETTYPE_LAYER (int)
Each layer only has connections to the next layer.
FANN_NETTYPE_SHORTCUT (int)
Each layer has connections to all following layers
Errors
FANN_E_NO_ERROR (int)
No error.
FANN_E_CANT_OPEN_CONFIG_R (int)
Unable to open configuration file for reading.
FANN_E_CANT_OPEN_CONFIG_W (int)
Unable to open configuration file for writing.
FANN_E_WRONG_CONFIG_VERSION (int)
Wrong version of configuration file.
FANN_E_CANT_READ_CONFIG (int)
Error reading info from configuration file.
FANN_E_CANT_READ_NEURON (int)
Error reading neuron info from configuration file.
FANN_E_CANT_READ_CONNECTIONS (int)
Error reading connections from configuration file.
FANN_E_WRONG_NUM_CONNECTIONS (int)
Number of connections not equal to the number expected.
FANN_E_CANT_OPEN_TD_W (int)
Unable to open train data file for writing.
FANN_E_CANT_OPEN_TD_R (int)
Unable to open train data file for reading.
FANN_E_CANT_READ_TD (int)
Error reading training data from file.
FANN_E_CANT_ALLOCATE_MEM (int)
Unable to allocate memory.
FANN_E_CANT_TRAIN_ACTIVATION (int)
Unable to train with the selected activation function.
FANN_E_CANT_USE_ACTIVATION (int)
Unable to use the selected activation function.
FANN_E_TRAIN_DATA_MISMATCH (int)
Irreconcilable differences between two struct fann_train_data structures.
FANN_E_CANT_USE_TRAIN_ALG (int)
Unable to use the selected training algorithm.
FANN_E_TRAIN_DATA_SUBSET (int)
Trying to take subset which is not within the training set.
FANN_E_INDEX_OUT_OF_BOUND (int)
Index is out of bound.
FANN_E_SCALE_NOT_PRESENT (int)
Scaling parameters not present.
FANN_E_INPUT_NO_MATCH (int)
The number of input neurons in the ann and data do not match
FANN_E_OUTPUT_NO_MATCH (int)
The number of output neurons in the ann and data do not match.

add a note

User Contributed Notes 1 note

up
0
aaroncr+php at gmail dot com
3 months ago
RELU and L-RELU activation functions are listed in the C++ library enum (fann_data.h:~214) but PHP constants have not been assigned for them as of this note. You can add them yourself:

define('FANN_LINEAR_PIECE_RECT', 18);
define('FANN_LINEAR_PIECE_RECT_LEAKY', 19);
To Top