25 printf(
"------------------------------\n");
28 for (
int o=0; o<col-1; o++) printf(
" ");
32 for (
int o=0; o<col-1; o++) printf(
" ");
33 printf(
"------------------------------\n");
51 for (
int o=0; o<col-2; o++) strcat(imgStr,
" ");
55 strcat(imgStr, img->
pixel[y*MNIST_IMG_HEIGHT+x] ?
"X" :
"." );
63 printf(
" Label:%d Classification:%d\n\n",lbl,cls);
83 double accuracy = 1 - ((double)errCount/(
double)(imgCount+1));
85 printf(
"Result: Correct=%5d Incorrect=%5d Accuracy=%5.4f%% \n",imgCount+1-errCount, errCount, accuracy*100);
97 printf(
"2: TESTING: Reading image No. %5d of %5d images [%3d%%] ",(imgCount+1),
MNIST_MAX_TESTING_IMAGES,(
int)progress);
100 double accuracy = 1 - ((double)errCount/(
double)(imgCount+1));
102 printf(
"Result: Correct=%5d Incorrect=%5d Accuracy=%5.4f%% \n",imgCount+1-errCount, errCount, accuracy*100);
void displayImage(MNIST_Image *img, int lbl, int cls, int row, int col)
Outputs a 28x28 MNIST image as charachters ("."s and "X"s)
Utitlies for displaying processing details in the terminal.
uint8_t pixel[MNIST_IMG_WIDTH *MNIST_IMG_HEIGHT]
void displayTrainingProgress(int imgCount, int errCount, int y, int x)
Outputs reading progress while processing MNIST training images.
Utitlies for advanced input and output to terminal screen.
#define MNIST_MAX_TESTING_IMAGES
number of images+labels in the TEST file/s
void locateCursor(const int row, const int col)
Set cursor position to given coordinates in the terminal window.
#define MNIST_IMG_HEIGHT
image height in pixel
#define MNIST_IMG_WIDTH
image width in pixel
void displayImageFrame(int row, int col)
Outputs a 28x28 text frame at a defined screen position.
Utitlies for handling the MNIST files.
void displayTestingProgress(int imgCount, int errCount, int y, int x)
Data block defining a MNIST image.
#define MNIST_MAX_TRAINING_IMAGES
number of images+labels in the TRAIN file/s