MNIST-3LNN  1.0
A simple 3-layer neural network to recognize handwritten single digit numbers from the MNIST image files.
Data Structures | Typedefs | Enumerations | Functions
3lnn.h File Reference

Neural network functionality for a 3-layer (INPUT, HIDDEN, OUTPUT) feed-forward, back-prop NN. More...

Go to the source code of this file.

Data Structures

struct  Vector
 Dynamic data structure containing defined number of values. More...
 
struct  Node
 Dynamic data structure modeling a neuron with a variable number of connections/weights. More...
 
struct  Layer
 Dynamic data structure holding a definable number of nodes that form a layer. More...
 
struct  Network
 Dynamic data structure holding the whole network. More...
 

Typedefs

typedef struct Network Network
 
typedef struct Layer Layer
 
typedef struct Node Node
 
typedef struct Vector Vector
 
typedef enum LayerType LayerType
 
typedef enum ActFctType ActFctType
 

Enumerations

enum  LayerType { INPUT, HIDDEN, OUTPUT }
 
enum  ActFctType { SIGMOID, TANH }
 

Functions

NetworkcreateNetwork (int inpCount, int hidCount, int outCount)
 Creates a dynamically-sized, 3-layer (INTPUT, HIDDEN, OUTPUT) neural network. More...
 
void feedInput (Network *nn, Vector *v)
 Feeds some Vector data into the INPUT layer of the NN. More...
 
void feedForwardNetwork (Network *nn)
 Feeds input layer values forward to hidden to output layer (calculation and activation fct) More...
 
void backPropagateNetwork (Network *nn, int targetClassification)
 Back propagates network error from output layer to hidden layer. More...
 
int getNetworkClassification (Network *nn)
 Returns the network's classification using the ID of teh node with the hightest output. More...
 

Detailed Description

Neural network functionality for a 3-layer (INPUT, HIDDEN, OUTPUT) feed-forward, back-prop NN.

Author
Matt Lind
Date
August 2015

Definition in file 3lnn.h.

Typedef Documentation

typedef enum ActFctType ActFctType
typedef struct Layer Layer

Definition at line 13 of file 3lnn.h.

typedef enum LayerType LayerType
typedef struct Network Network

Definition at line 12 of file 3lnn.h.

typedef struct Node Node

Definition at line 14 of file 3lnn.h.

typedef struct Vector Vector

Definition at line 15 of file 3lnn.h.

Enumeration Type Documentation

enum ActFctType
Enumerator
SIGMOID 
TANH 

Definition at line 18 of file 3lnn.h.

enum LayerType
Enumerator
INPUT 
HIDDEN 
OUTPUT 

Definition at line 17 of file 3lnn.h.

Function Documentation

void backPropagateNetwork ( Network nn,
int  targetClassification 
)

Back propagates network error from output layer to hidden layer.

Parameters
nnA pointer to the NN
targetClassificationCorrect classification (=label) of the input stream

Definition at line 206 of file 3lnn.c.

Network* createNetwork ( int  inpCount,
int  hidCount,
int  outCount 
)

Creates a dynamically-sized, 3-layer (INTPUT, HIDDEN, OUTPUT) neural network.

Parameters
inpCountNumber of nodes in the INPUT layer
hidCountNumber of nodes in the HIDDEN layer
outCountNumber of nodes in the OUTPUT layer

Definition at line 505 of file 3lnn.c.

void feedForwardNetwork ( Network nn)

Feeds input layer values forward to hidden to output layer (calculation and activation fct)

Parameters
nnA pointer to the NN

Definition at line 306 of file 3lnn.c.

void feedInput ( Network nn,
Vector v 
)

Feeds some Vector data into the INPUT layer of the NN.

Parameters
nnA pointer to the NN
vA pointer to a vector

Definition at line 320 of file 3lnn.c.

int getNetworkClassification ( Network nn)

Returns the network's classification using the ID of teh node with the hightest output.

Parameters
nnA pointer to the NN

Definition at line 553 of file 3lnn.c.