next up previous contents index
Next: Special Network Architectures Up: Including the Compiled Previous: Interfaces:


If a trained network, was saved as ``'' and compiled with snns2c

then the generated Network can be compiled with gcc -c myNetwork.c

To include the network in your own application the header file must be included. There should also two arrays being provided, one for the input and one for the output of the network. The number of inputs and outputs can be derived from a record in the header file. This struct is named like the function which contains the compiled network and has the suffix REC to mark the record. So the number of input units is determined with myNetworkREC.NoOfInput and the number of outputs with myNetworkREC.NoOfOutput in this example. Hence, your own application should contain:

#include "myNetwork.h"
float *netInput, *netOutput; /* Input and Output arrays of the Network */
netInput  = malloc(myNetworkREC.NoOfInput  * sizeof(float));
netOutput = malloc(myNetworkREC.NoOfOutput * sizeof(float));
myNetwork(netInput, netOutput, 0)

Don't forget to link the object code of the network to your application
Tue Nov 28 10:30:44 MET 1995