Commit 51c0cf6ed9cc10667344145c59bc91aefbdf1c20

Authored by David Mayerich
1 parent ed5edb3e

cleaned up the metric calculation

Showing 2 changed files with 11 additions and 7 deletions   Show diff stats
@@ -2,5 +2,6 @@ v -1 1 0 @@ -2,5 +2,6 @@ v -1 1 0
2 v 0 0 0 2 v 0 0 0
3 v 1 -1 0 3 v 1 -1 0
4 v 1 1 0 4 v 1 1 0
5 -l 1 2 3 5 +l 1 2
  6 +l 2 3
6 l 4 2 7 l 4 2
@@ -18,21 +18,24 @@ int main(int argc, char* argv[]) @@ -18,21 +18,24 @@ int main(int argc, char* argv[])
18 exit(1); 18 exit(1);
19 } 19 }
20 20
  21 + float resample_rate = 0.1;
  22 +
21 float sigma = atof(argv[3]); 23 float sigma = atof(argv[3]);
22 stim::network<float> GT;stim::network<float> T; 24 stim::network<float> GT;stim::network<float> T;
23 // load obj files to 3D network class 25 // load obj files to 3D network class
24 GT.load_obj(argv[1]); 26 GT.load_obj(argv[1]);
25 T.load_obj(argv[2]); 27 T.load_obj(argv[2]);
26 - //std::cout<<"ground truth------"<<GT.str()<<std::endl;  
27 - //std::cout<<"truth-----------"<<T.str()<<std::endl; 28 +
28 // resample the loaded networks 29 // resample the loaded networks
29 stim::network<float> resampled_GT;stim::network<float> resampled_T; 30 stim::network<float> resampled_GT;stim::network<float> resampled_T;
30 - resampled_GT = GT.resample(sigma);  
31 - resampled_T = T.resample(sigma); 31 +
  32 + resampled_GT = GT.resample(sigma * resample_rate);
  33 + resampled_T = T.resample(sigma * resample_rate);
  34 +
32 // compare ground truth with truth and viceversa 35 // compare ground truth with truth and viceversa
33 float gFPR, gFNR; 36 float gFPR, gFNR;
34 - gFPR = GT.compare(T, sigma);  
35 - gFNR = T.compare(GT, sigma); 37 + gFPR = resampled_GT.compare(resampled_T, sigma);
  38 + gFNR = resampled_T.compare(resampled_GT, sigma);
36 // print false alarms and misses 39 // print false alarms and misses
37 std::cout << "False postive rate is " << gFPR << std::endl; 40 std::cout << "False postive rate is " << gFPR << std::endl;
38 std::cout << "False negative rate is " << gFNR << std::endl; 41 std::cout << "False negative rate is " << gFNR << std::endl;