-
Notifications
You must be signed in to change notification settings - Fork 0
/
1
66 lines (51 loc) · 1.31 KB
/
1
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# include <sstream>
# include<iostream>
# include <fstream>
# include <string>
# include <vector>
# include <stdlib.h>
# include <algorithm>
# include <iterator>
# include <cstdlib>
# include <math.h>
# include <iterator>
#include <ctime>
#include <cstring>
#include <stdio.h>
# include "LabelPropagation.hpp"
using namespace std;
int main(int argc, char* argv[])
{
LabelPropagation lp;
FILE* fp;
fp=fopen(argv[1],"r");
char paramName[50];
char paramType[50];
char paramValue[50];
char line[100];
while (fgets(line,500,fp) != NULL) {
if(line[0]!='#')
{
sscanf(line,"%s %s %s",paramName,paramType,paramValue);
if(strcmp(paramName,"weightFile")==0)
lp.weightFile=paramValue;
if(strcmp(paramName,"labelFile")==0)
lp.labelFile=paramValue;
if(strcmp(paramName,"noExamples")==0)
lp.noExamples=atoi(paramValue);
if(strcmp(paramName,"lbr")==0)
lp.lbr=atoi(paramValue);
if(strcmp(paramName,"noitr")==0)
lp.noIterations=atoi(paramValue);
}
}
cout<< "params are: "<< "No. of Exmaples"<<lp.noExamples<<" \t"<< " Weight filename:"<< lp.weightFile<<"\t"<< "Iterations:"<<lp.noIterations<< "\t"<< "Labeling Rate :"<<lp.lbr<<endl;
lp.LoadWeightMatrix();
//lp.DisplayWeightMatrix();
lp.TransitionMatrixCal();
//lp.DisplayTransitionMatrix();
lp.PrepareYMatrix();
lp.LPAlgorithm();
//lp.DisplayYMatrix();
lp.DisplayActYMatrix();
}