-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
32 lines (21 loc) · 816 Bytes
/
main.cpp
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
#include <stdio.h>
#include "CNN.hpp"
int main(int argc, char **argv)
{
using namespace std;
cout << "Start..." << endl;
CNN cnn(50);
cout << "cnn build successfully..." << endl;
string fileName("dataset/train.format");
Dataset trainset(784);
//trainset.loadFile(fileName, ",");
trainset.readTestFile("dataset/train-images.idx3-ubyte", "dataset/train-labels.idx1-ubyte");
// trainset.readTestFile("dataset/t10k-images.idx3-ubyte", "dataset/t10k-labels.idx1-ubyte");
cout << "trainset build successfully..." << endl;
cnn.train(trainset, 10);
trainset.clear();
Dataset testset(-1);
testset.readTestFile("dataset/t10k-images.idx3-ubyte", "dataset/t10k-labels.idx1-ubyte");
cnn.predict(testset);
printf("hello world\n");
}