-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.cpp
More file actions
37 lines (34 loc) · 1.59 KB
/
example.cpp
File metadata and controls
37 lines (34 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
#include <vector>
#include "./mnist/readMnist.hpp"
using namespace std;
int main()
{
vector<vector<vector<int> > > testImages = ReadTestImages();// ReadImages("./mnist/t10k-images-idx3-ubyte");
vector<vector<vector<int> > > trainImages = ReadTrainImages(); //ReadImages("./mnist/train-images-idx3-ubyte");
/* If you want the images not being in two values 0, 1:
vector<vector<vector<int> > > testImages = ReadTestImages(false);// ReadImages("./mnist/t10k-images-idx3-ubyte");
vector<vector<vector<int> > > trainImages = ReadTrainImages(false); //ReadImages("./mnist/train-images-idx3-ubyte");
*/
vector<int> testLabels = readTestLabels(); //ReadLabels("./mnist/t10k-labels-idx1-ubyte");
vector<int> trainLabels = readTrainLabels(); //ReadLabels("./mnist/train-labels-idx1-ubyte");
cout << "******************************************************" << endl;
cout << "Training example of number: " << trainLabels[0] << endl;
cout << "******************************************************" << endl;
for (unsigned int y = 0; y < 28; y++){
for (unsigned int z = 0; z < 28; z++){
cout << trainImages[0][y][z] << " ";
}
cout << endl;
}
cout << "******************************************************" << endl;
cout << "Test example of number: " << testLabels[0] << endl;
cout << "******************************************************" << endl;
for (unsigned int y = 0; y < 28; y++){
for (unsigned int z = 0; z < 28; z++){
cout << testImages[0][y][z] << " ";
}
cout << endl;
}
return 0;
}