0 |
Fann C Extensions 2.0.0Important informationThe Fann C Extensions are subject to change at any time and only work with Fann version 2.0.0. The extensions will change as similar functionality becomes available in the Fann Library. The changes may require code changes. OverviewFann C Extensions gives access to neural network layout, connections, and weights. The save_ex functions are no longer available as similar functionality is now present in the Fann C Library - remove the _ex postfix to use them. DownloadThe Fann C Extensions header and documentation is included in the Fann C++ Wrapper. Download it here: http://www.sourceforge.net/projects/fann Example See the end of the fann_extensions.h file for a small example. The C++ Wrapper and fannKernel uses the Fann C Extensions. Summary
C Extension Data and TypesSummary
fann_network_typesDefinition of network types used by fann_get_network_type
See AlsoC Extension FunctionsSummary
fann_get_network_type
Get the type of neural network it was created as. Parameters
ReturnsThe neural network type from enum fann_network_types See Alsofann_get_num_layers
Get the number of layers in the network Parameters
ReturnsThe number of layers in the neural network Example// Obtain the number of layers in a neural network fann_get_layer_array
Get the number of neurons in each layer in the network. Bias is not included so the layers match the fann_create functions. Parameters
The layers array must be preallocated to at least sizeof(unsigned int) * fann_num_layers() long. fann_get_bias_array
Get the number of bias in each layer in the network. Parameters
The bias array must be preallocated to at least sizeof(unsigned int) * fann_num_layers() long. fann_get_connection_array
Get the connections in the network. Parameters
The connections array must be preallocated to at least sizeof(struct fann_connection) * fann_get_total_connections() long. fann_set_weight_array
Set connections in the network. Parameters
Only the weights can be changed, connections and weights are ignored if they do not already exist in the network. The array must have sizeof(struct fann_connection) * num_connections size. fann_set_weight
Set a connection in the network. Parameters
Only the weights can be changed. The connection/weight is ignored if it does not already exist in the network. fann_get_activation_function
Get the activation function for neuron number neuron in layer number layer, counting the input layer as layer 0. It is not possible to get activation functions for the neurons in the input layer. Information about the individual activation functions is available at <fann_activationfunc_enum>. ReturnsThe activation function for the neuron or -1 if the neuron is not defined in the neural network. See also<fann_set_activation_function_layer>, <fann_set_activation_function_hidden>, <fann_set_activation_function_output>, <fann_set_activation_steepness> This function appears in FANN >= 2.0.1. fann_get_activation_steepness
Get the activation steepness for neuron number neuron in layer number layer, counting the input layer as layer 0. It is not possible to get activation steepness for the neurons in the input layer. The steepness of an activation function says something about how fast the activation function goes from the minimum to the maximum. A high value for the activation function will also give a more agressive training. When training neural networks where the output values should be at the extremes (usually 0 and 1, depending on the activation function), a steep activation function can be used (e.g. 1.0). The default activation steepness is 0.5. ReturnsThe activation steepness for the neuron or -1 if the neuron is not defined in the neural network. See also<fann_set_activation_steepness_layer>, <fann_set_activation_steepness_hidden>, <fann_set_activation_steepness_output>, <fann_set_activation_function> This function appears in FANN >= 2.0.1. |
Get the type of neural network it was created as.
enum fann_network_types fann_get_network_type( struct fann * ann )
Get the connection rate used when the network was created
float fann_get_connection_rate( struct fann * ann )
Get the number of layers in the network
unsigned int fann_get_num_layers( struct fann * ann )
Get the number of neurons in each layer in the network.
void fann_get_layer_array( struct fann * ann, unsigned int * layers )
Get the number of bias in each layer in the network.
void fann_get_bias_array( struct fann * ann, unsigned int * bias )
Get the connections in the network.
void fann_get_connection_array( struct fann * ann, struct fann_connection * connections )
Set connections in the network.
void fann_set_weight_array( struct fann * ann, struct fann_connection * connections, unsigned int num_connections )
Set a connection in the network.
void fann_set_weight( struct fann * ann, unsigned int from_neuron, unsigned int to_neuron, fann_type weight )
Get the activation function for neuron number neuron in layer number layer, counting the input layer as layer 0.
FANN_EXTERNAL enum fann_activationfunc_enum FANN_API fann_get_activation_function( struct fann * ann, int layer, int neuron )
Get the activation steepness for neuron number neuron in layer number layer, counting the input layer as layer 0.
FANN_EXTERNAL fann_type FANN_API fann_get_activation_steepness( struct fann * ann, int layer, int neuron )