|
Functions |
void | net_randomize (network_t *net, float range) |
| Assign random values to all weights in the network.
|
void | net_reset_deltas (network_t *net) |
| Set deltas of the network to 0.
|
void | net_use_bias (network_t *net, int flag) |
| Enable or disable use of bias.
|
static void | allocate_layer (layer_t *layer, int no_of_neurons) |
| [Internal] Allocate memory for the neurons in a layer of a network.
|
static void | allocate_weights (layer_t *lower, layer_t *upper) |
| [Internal] Allocate memory for the weights connecting two layers.
|
network_t * | net_allocate_l (int no_of_layers, const int *arglist) |
| Allocate memory for a network.
|
network_t * | net_allocate (int no_of_layers,...) |
| Allocate memory for a network.
|
void | net_free (network_t *net) |
| Free memory allocated for a network.
|
void | net_set_momentum (network_t *net, float momentum) |
| Change the momentum of a network.
|
float | net_get_momentum (const network_t *net) |
| Retrieve the momentum of a network.
|
void | net_set_learning_rate (network_t *net, float learning_rate) |
| Change the learning rate of a network.
|
float | net_get_learning_rate (const network_t *net) |
| Retrieve the momentum of a network.
|
int | net_get_no_of_inputs (const network_t *net) |
| Retrieve the number of inputs of a network.
|
int | net_get_no_of_outputs (const network_t *net) |
| Retrieve the number of outputs of a network.
|
int | net_get_no_of_layers (const network_t *net) |
| Retrieve the number of layers of a network.
|
int | net_get_no_of_weights (const network_t *net) |
| Retrieve the number of weights of a network.
|
void | net_set_weight (network_t *net, int l, int nl, int nu, float weight) |
| Set a weight of a network.
|
float | net_get_weight (const network_t *net, int l, int nl, int nu) |
| Retrieve a weight of a network.
|
float | net_get_bias (const network_t *net, int l, int nu) |
| Retrieve a bias weight of a network.
|
void | net_set_bias (network_t *net, int l, int nu, float weight) |
| Retrieve a bias weight of a network.
|
int | net_fprint (FILE *file, const network_t *net) |
| Write a network to a file.
|
network_t * | net_fscan (FILE *file) |
| Read a network from a file.
|
int | net_print (const network_t *net) |
| Write a network to a stdout.
|
int | net_save (const char *filename, const network_t *net) |
| Write a network to a file.
|
network_t * | net_load (const char *filename) |
| Read a network from a file.
|
int | net_fbprint (FILE *file, const network_t *net) |
| Write a network to a binary file.
|
network_t * | net_fbscan (FILE *file) |
| Read a network from a binary file.
|
int | net_bsave (const char *filename, const network_t *net) |
| Write a network to a binary file.
|
network_t * | net_bload (const char *filename) |
| Read a network from a binary file.
|
static void | set_input (network_t *net, const float *input) |
| [Internal] Copy inputs to input layer of a network.
|
static void | get_output (const network_t *net, float *output) |
| [Interal] Copy outputs from output layer of a network.
|
static float | sigma (float x) |
| [Internal] Activation function of a neuron.
|
static void | propagate_layer (layer_t *lower, layer_t *upper) |
| [Internal] Forward propagate inputs from one layer to next layer.
|
static void | forward_pass (network_t *net) |
| [Internal] Forward propagate inputs through a network.
|
float | net_compute_output_error (network_t *net, const float *target) |
| Compute the output error of a network.
|
float | net_get_output_error (const network_t *net) |
| Retrieve the output error of a network.
|
static void | backpropagate_layer (layer_t *lower, layer_t *upper) |
| [Internal] Backpropagate error from one layer to previous layer.
|
static void | backward_pass (network_t *net) |
| [Internal] Backpropagate output error through a network.
|
static void | adjust_weights (network_t *net) |
| [Internal] Adjust weights based on (backpropagated) output error.
|
void | net_compute (network_t *net, const float *input, float *output) |
| Compute outputs of a network for given inputs.
|
void | net_train (network_t *net) |
| Train a network.
|
static void | adjust_deltas_batch (network_t *net) |
| [Internal] Adjust deltas based on (backpropagated) output error.
|
static void | adjust_weights_batch (network_t *net) |
| [Internal] Adjust weights based on deltas determined by batch training.
|
void | net_begin_batch (network_t *net) |
| Begin training in batch mode.
|
void | net_train_batch (network_t *net) |
| Train a network in batch mode.
|
void | net_end_batch (network_t *net) |
| End training in batch mode adjusting weights.
|
void | net_jolt (network_t *net, float factor, float range) |
| Make small random changes to the weights of a network.
|
void | net_add_neurons (network_t *net, int layer, int neuron, int number, float range) |
| Add neurons to a network.
|
void | net_remove_neurons (network_t *net, int layer, int neuron, int number) |
| Remove neurons from a network.
|
network_t * | net_copy (const network_t *net) |
| Copy a network.
|
void | net_overwrite (network_t *dest, const network_t *src) |
| Overwrite one network with another.
|
This is a lightweight library implementating a neural network for use in C and C++ programs. It is intended for use in applications that just happen to need a simply neural network and do not want to use needlessly complex neural network libraries. It features multilayer feedforward perceptron neural networks, sigmoidal activation function with bias, backpropagation training with settable learning rate and momentum, and backpropagation training in batches.