-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm3.cc
36 lines (26 loc) · 826 Bytes
/
m3.cc
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
#include "ece408net.h"
#include "ece408test.cc"
void inference_only(int batch_size) {
std::cout<<"Loading fashion-mnist data...";
MNIST dataset("../data/fmnist-86/");
dataset.read_test_data(batch_size);
std::cout<<"Done"<<std::endl;
std::cout<<"Loading model...";
Network dnn = createNetwork_GPU();
std::cout<<"Done"<<std::endl;
dnn.forward(dataset.test_data);
float acc = compute_accuracy(dnn.output(), dataset.test_labels);
std::cout<<std::endl;
std::cout<<"Test Accuracy: "<<acc<< std::endl;
std::cout<<std::endl;
}
int main(int argc, char* argv[]) {
run_testcase("../ece408/project/testcases", false);
int batch_size = 5000;
if(argc == 2){
batch_size = atoi(argv[1]);
}
std::cout<<"Test batch size: "<<batch_size<<std::endl;
inference_only(batch_size);
return 0;
}