11 #define NUMBER_OF_INPUT_CELLS 784
12 #define NUMBER_OF_OUTPUT_CELLS 10
14 #define LEARNING_RATE 0.05
Cell cell[NUMBER_OF_OUTPUT_CELLS]
Data structure containing defined number of integer values (the output vector contains values for 0-9...
int getLayerPrediction(Layer *l)
Returns the index of the cell with the hightest output.
void calcCellOutput(Cell *c)
Calculates a cell's output by suming all input-weight-products.
Vector getTargetOutput(int targetIndex)
Returns an output vector with targetIndex set to 1, all others to 0.
void testCell(Cell *c, MNIST_Image *img, int target)
Performs the testing of the trained network.
void trainCell(Cell *c, MNIST_Image *img, int target)
Performs the training algorithm.
void initLayer(Layer *l)
Initialize layer by setting all weights to random values [0-1].
#define NUMBER_OF_OUTPUT_CELLS
use 10 output cells to model 10 digits (0-9)
Core unit of the neural network (neuron and synapses)
The single (output) layer of this network (a layer is number cells)
double weight[NUMBER_OF_INPUT_CELLS]
double getCellError(Cell *c, int target)
Returns the difference between a target value and the cell's ouput.
#define NUMBER_OF_INPUT_CELLS
use 28*28 input cells (= number of pixels per MNIST image)
int val[NUMBER_OF_OUTPUT_CELLS]
double input[NUMBER_OF_INPUT_CELLS]
void updateCellWeights(Cell *c, double err)
Updates a cell's weights based on given error and LEARNING_RATE.
Data block defining a MNIST image.
void setCellInput(Cell *c, MNIST_Image *img)
Sets a cell's input according to the pixels of a given MNIST image.