Description
net_add_neurons
: Add neurons to layer layer
of the neural network. The input layer has number 0 and the output layer has number net_no_of_layers(net) - 1
. The new neurons get inserted before the neuron
th neuron of this layer, where the neurons are numbered staring from 0. As a special case, -1 can be specified to add the neurons after the last neuron of this layer. The new neurons will be connected to the other neurons with random weights from the interval [-range
, range
].
net_allocate
: Allocate resources for a neural network. The number of layers is n
, including the input and output layer, i0
is the number of neurons in the input layer, i(n-1)
is the number of neurons in the output layer and i2
, ...,i(n-2)
are the number of neurons in the hidden layers. Return value is a pointer to the newly allocated neural network.
net_allocate_l
: Allocate resources for a neural network. In contrast to net_allocate
, this routine takes a pointer to an array containing the number of neurons in each layer. Return value is a pointer to the newly allocated neural network.
net_begin_batch
: Start a new batch for batch training.
net_bload
: Read a binary representation of a neural network from a file. The file is specified by filename. This route will open the file before reading from it and will close it after reading from it. Resources for this network are allocated as with net_allocate
and it is the caller’s responsibility to free these resources with net_free
when the network is no longer needed. Return value is a pointer to the newly allocated and read neural network on success and NULL
on failure.
net_bsave
: Write a binary representation of the neural network to a file. The file is specified by filename
. This routine will open the file before writing to it and will close it after writing to it. Return value is 0 on success and a negative value on failure. Note that this is not necessarily portable across platforms.
net_compute
: Compute the outputs of the neural network for the given inputs. The outputs of the network will be copied to output
, unless output
is NULL
.
net_compute_output_error
: Compute the output error of the neural network. This routine should be called after a call to net_compute
. Return value is the global output error.
net_copy
: Copy a neural network. Resources for the copy are allocated as with net_allocate and it is the caller’s responsibility to free these resources with net_free
when the copy is no longer needed. Return value is a pointer to the copy.
net_end_batch
: End a batch for batch training. This will update the weights of the neural network.
net_fbprint
: Write a binary representation of the neural network to a file. Return value is 0 on success and a negative number on failure. Note that this is not necessarily portable across platforms.
net_fbscan
: Read a binary representation of a neural network from a file. Resources for this network are allocated as with allocate_network
and it is the caller’s responsibility to free these resources with net_free
when the network is no longer needed. Return value is a pointer to the newly allocated and read neural network on success and NULL
on failure.
net_fprint
: Write a representation of the neural network to a file. Return value is 0 on success and a negative number on failure.
net_free
: Free the resources allocated for the neural network.
net_fscan
: Read a representation of a neural network from a file. Resources for this network are allocated as with allocate_network
and it is the caller’s responsibility to free these resources with net_free
when the network is no longer needed. Return value is a pointer to the newly allocated and read neural network on success and NULL
on failure.
net_get_learning_rate
: Get the learning rate of the neural network.
net_get_momentum
: Get the momentum of the neural network.
*net_get_no_of_inputs
: Get the number of inputs of the neural network.
net_get_no_of_layers
: Get the number of layers, including the input and output layer, of the neural network.
net_get_no_of_outputs
: Get the number of outputs of the neural network.
net_get_no_of_weights
: Get the total number of weights of the neural network.
net_get_output_error
: Get the output error of the neural network. The routine should be called after a call to net_compute_output_error
.
net_get_weight
: Get the weight from neuron from_neuron
in layer to_layer-1
to neuron to_neuron
in layer layer
. Note that the layers and neurons are numbered starting from 0.
net_jolt
: Make small changes to the weight in the neural network. All weights that are in absolute value smaller than range
become a random weight from the interval [-range
, range
]. All other weights get multiplied by a random factor from the interval [1-factor
, 1+factor
].
net_load
: Read a representation of a neural network from a file. The file is specified by filename
. This route will open the file before reading from it and will close it after reading from it. Resources for the network are allocated as with net_allocate
and it is the caller’s responsibility to free these resources with net_free
when the network is no longer needed. Return value is a pointer to the newly allocated and read neural network on success and NULL
on failure.
net_randomize
: Assign random weights to the nodes in the neural network. The weights are chosen from a uniform distribution over the interval [-range
, range
].
net_reset_deltas
: Change all the deltas in the neural network to 0.
net_set_learning_rate
: Set the learning rate of the neural network.
net_set_momentum
: Set the momentum of the neural network.
net_set_weight
: Set the weight from neuron from_neuron
in layer to_layer-1
to neuron to_neuron
in layer layer
to the value weight
. Note that the layers and neurons are numbered starting from 0.
net_print
: Write a representation of the neural network to stdout. Return value is 0 on success and a negative value on failure.
net_remove_neurons
: Remove the neuronth to (neuron+number-1
)th neurons from layer layer
of the neural network.
net_save
: Write a representation of the neural network to a file. The file is specified by filename
. This routine will open the file before writing to it and will close it after writing to it. Return value is 0 on success and a negative value on failure.
net_overwrite
: Overwrite one neural network with another neural network.
net_train
: Train the neural network towards the target. This routine should be called after calls to net_compute
and net_compute_output_error
. Note that the target to which to train the network is set in the call to net_compute_output_error
.
net_train_batch
: Compute the changes needed to train the network towards the target. This routine should be called after a call to net_begin_batch
and after calls to net_compute
and net_compute_output_error
. Note that the target to which to train the network is set in the call to net_compute_output_error
. The weights of the network will be updated when net_end_batch
is called.