MNIST-3LNN  1.0
A simple 3-layer neural network to recognize handwritten single digit numbers from the MNIST image files.
Functions
mnist-utils.c File Reference

Utitlies for handling the MNIST files. More...

#include <stdlib.h>
#include <string.h>
#include "mnist-utils.h"

Go to the source code of this file.

Functions

uint32_t flipBytes (uint32_t n)
 
void readImageFileHeader (FILE *imageFile, MNIST_ImageFileHeader *ifh)
 
void readLabelFileHeader (FILE *imageFile, MNIST_LabelFileHeader *lfh)
 
FILE * openMNISTImageFile (char *fileName)
 Read MNIST IMAGE file header. More...
 
FILE * openMNISTLabelFile (char *fileName)
 Read MNIST label file header. More...
 
MNIST_Image getImage (FILE *imageFile)
 Returns the next image in given MNIST image file. More...
 
MNIST_Label getLabel (FILE *labelFile)
 Returns the next label in given MNIST label file. More...
 
int getStandardDigitPixel (int num, int pixelId)
 

Detailed Description

Utitlies for handling the MNIST files.

See also
http://yann.lecun.com/exdb/mnist/
Author
Matt Lind
Date
July 2015

Definition in file mnist-utils.c.

Function Documentation

uint32_t flipBytes ( uint32_t  n)

Reverse byte order in 32bit numbers MNIST files contain all numbers in reversed byte order, and hence must be reversed before using

Definition at line 22 of file mnist-utils.c.

MNIST_Image getImage ( FILE *  imageFile)

Returns the next image in given MNIST image file.

Returns the next image in the given MNIST image file

Definition at line 139 of file mnist-utils.c.

MNIST_Label getLabel ( FILE *  labelFile)

Returns the next label in given MNIST label file.

Returns the next label in the given MNIST label file

Definition at line 159 of file mnist-utils.c.

int getStandardDigitPixel ( int  num,
int  pixelId 
)

Definition at line 178 of file mnist-utils.c.

FILE* openMNISTImageFile ( char *  fileName)

Read MNIST IMAGE file header.

Open MNIST image file and read header info by reading the header info, the read pointer is moved to the position of the 1st IMAGE

Definition at line 93 of file mnist-utils.c.

FILE* openMNISTLabelFile ( char *  fileName)

Read MNIST label file header.

Open MNIST label file and read header info by reading the header info, the read pointer is moved to the position of the 1st LABEL

Definition at line 117 of file mnist-utils.c.

void readImageFileHeader ( FILE *  imageFile,
MNIST_ImageFileHeader ifh 
)

Read MNIST image file header

See also
http://yann.lecun.com/exdb/mnist/ for definition details

Definition at line 43 of file mnist-utils.c.

void readLabelFileHeader ( FILE *  imageFile,
MNIST_LabelFileHeader lfh 
)

Read MNIST label file header

See also
http://yann.lecun.com/exdb/mnist/ for definition details

Definition at line 71 of file mnist-utils.c.