NEURAL(NETWORK)

NAME
NNLayer, NNClassifyVector, NNClassify, NNReadASCII, NNRead, NNWrite, NNLoad,NNFree

SYNOPSIS

#include <speech.h>

in NNLayer ( NueralNet *nn, int layer, float *ivec, float *ovec);

int NNClassifyVector ( NeuralNet *nn, float *ivec, float *ovec);

inr NNClassify (float *fvec, NeuralNet *nn);

int NNReadASCII (FILE *inp, NeuralNet *nn);

int NNRead (FILE *fileptr, NeuralNet *nn);

int NNWrite (FILE *fp, NeuralNet *nn);

int NNLoad(char *filename, NeuralNet *nn);

int NNFree (NeuralNet *nn);

DESCRIPTION

These routines are used to manipulate fully connected feedforward neural networks.

NNLayer() is used to calculate the neural activations for each node (neuron) in each of the layers of the neural network. nn describes the structure of the neural network and has the following form:

    struct neuralnet {
        int nn_iter; /* iteration count */
        int nn_layers; /* number of layers */
        float *nn_w; /* array of weights */
        float **nn_act; /* array of activations */
        int *nn_sz; /* dimensions of each layer */
        int *nn_layeridx; /* starting indexs for layers */
    };
    typedef struct neuralnet NeuralNet

layer denotes the layer of the network to be computed. ivec and ovec denotes the input and resulting output vectors respectively.

NNClassifyVector() classifies the input vector ivec (vector of floating point values) and stores the resulting output neuron activations in ovec.

NNClassify() returns the integer class of the input vector ivec corresponding to the index of the neuron in the output layer with maximum activation.

NNReadASCII () reads the neural network ASCII configuration file using the file stream inp

NNRead () reads a binary neural net weight file produced by opt, using the file stream fileptr

NNWrite() Writes a neural network configuration of weights and structure in binary form to disk using the file pointer fp

NNLoad() reads in a specified binary neural net weight file denoted by filname

NNFree() Deallocates memory allocated in a neural net structure by NNRead(), NNReadASCII(), etc.

EXAMPLES
  NeuralNet mynet;
  float *invec;
 .int class;
 .
 .
  NNLoad("mynet", &mynet);
 .
 .
 .
  class = NNClassify(invec, &nn);
 .
 .
 .
  NNFree (&nn);

DIAGNOSTICS

All functions return -1 on error and sets ErrorString.

SEE ALSO
ErrorString(3SP), malloc(3), free(3), nopt(1)

BUGS

AUTHORS
Center for Spoken Language Understanding
Department of Computer Science and Engineering
Oregon Graduate Institute of Science & Technology