-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvaluationMSE.cpp
42 lines (34 loc) · 1.53 KB
/
EvaluationMSE.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
31
32
33
34
35
36
37
38
39
40
41
42
#include "stdafx.h"
#include <cascdynetinf.h>
#include <Evaluator.h>
int main(int argc, char* argv[]) {
Env = TEnv(argc, argv, TNotify::StdNotify);
Env.PrepArgs(TStr::Fmt("\nStochastic network inference. build: %s, %s. Time: %s", __TIME__, __DATE__, TExeTm::GetCurTm()));
TExeTm ExeTm;
Try
const TStr InFNm = Env.GetIfArgPrefixStr("-i:", "example-inferred-network.txt", "Input inferred networks");
const TStr GroundTruthFNm = Env.GetIfArgPrefixStr("-n:", "example-network.txt", "Input ground-truth network");
const TStr OutFNm = Env.GetIfArgPrefixStr("-o:", "network", "Output file name(s) prefix");
const TStr modelNm = Env.GetIfArgPrefixStr("-m:", "InfoPath", "Input model name(s)");
TStrV InFNms, modelNms;
InFNm.SplitOnAllCh(':',InFNms);
modelNm.SplitOnAllCh(':',modelNms);
Evaluator evaluator;
printf("\nLoading input ground truth: %s\n", GroundTruthFNm.CStr());
// load ground truth network
TFIn FGIn(GroundTruthFNm);
evaluator.LoadGroundTruth(FGIn);
printf("\nLoading input inferred networks: %s\n", InFNm.CStr());
for (int i=0;i<InFNms.Len();i++) {
printf("\nLoading %s\n", InFNms[i].CStr());
TFIn FIn(InFNms[i]);
evaluator.LoadInferredNetwork(FIn, modelNms[i]);
printf("\nLoading %s done\n", InFNms[i].CStr());
}
TVec<TFlt> steps1 = evaluator.GetSteps(0);
evaluator.EvaluateMSE(steps1.Last());
evaluator.PlotMSE(OutFNm);
Catch
printf("\nrun time: %s (%s)\n", ExeTm.GetTmStr(), TSecTm::GetCurTm().GetTmStr().CStr());
return 0;
}