NNF – Neural Net Framework
An high speed implementation of feed-forward neural nets
Functions reference
void
NNF_Init(NNF_NeuralNet* net, int
layrs, int neurs[], int
range); //initializes the neural net
//net
is a pointer to the neural net
//layrs is the number of layers in
the net
//neurs[] is the array of the neurons (its size must
correspond to the number of layers)
//range is the limit for
random weights generated during the initialization
void
NNF_Load(NNF_NeuralNet* net, FILE*
loadFile); //initializes the neural net
loading it from a file
//net is a pointer to the neural
net
//loadFile is a pointer to a text file, usually opened with
fopen("filename","r")
void
NNF_Save(NNF_NeuralNet* net, FILE*
saveFile); //saves the neural net
configuration on a file
//net is a pointer to the neural
net
//saveFile is a pointer to a text file, usually opened with
fopen("filename","w")
void
NNF_Reset(NNF_NeuralNet* net, int
range); //resets the weights of the neural
net
//net is a pointer to the neural net
//range is the
limit for random weights
float*
NNF_Execute(NNF_NeuralNet* net, float
input[]); //executes the neural net with the
given input
//net is a pointer to the neural net
//input[] is
the array of the input (its size must correspond to the number of
neurons
//in the first layer)
//return value is an array with
the calculated output (its size corresponds to the number
//of
neurons in the last layer
void
NNF_BackPropagate(NNF_NeuralNet* net,
float desired[]); //teaches
the neural net associating the desired values with the given
output
//net is a pointer to the neural net
//desired[] is the
array of the desired output (its size must correspond to the number
of neurons in the last layer
void
NNF_Delete(NNF_NeuralNet* net);
//deletes the neural net; calls free() for
all the dinamically allocated memory
//call this function when you
don't need the net anymore
Copyright (C) 2005 by Alessandro Presta