MNIST-1LNN  1.0
A simple 1-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 <stdio.h>
#include <stdlib.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...
 

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 23 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 140 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 160 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 94 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 118 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 44 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 72 of file mnist-utils.c.