-
Notifications
You must be signed in to change notification settings - Fork 0
/
train_main.cpp
102 lines (93 loc) · 3.08 KB
/
train_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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <cmd.h>
#include <rfbp.hpp>
int main (int argc, char *argv[])
{
bool bin,
binmess;
int nth,
mag;
long int K,
max_iters,
seed,
max_steps;
double randfact,
damping,
epsil;
std :: string patternsfile,
outfile,
del,
accuracy1,
accuracy2,
fprotocol,
inmess,
outmess,
delmess;
parse_training_fbp(argc, argv,
patternsfile,
outfile,
bin,
del,
K,
max_iters,
seed,
randfact,
damping,
accuracy1,
accuracy2,
fprotocol,
epsil,
nth,
max_steps,
mag,
inmess,
outmess,
delmess,
binmess);
FocusingProtocol fp(fprotocol, max_steps);
Patterns patterns(patternsfile, bin, del);
long int ** bin_weights = nullptr;
switch (mag)
{
case magP:
bin_weights = focusingBP < MagP64 >(K,
patterns,
max_iters,
max_steps,
seed,
damping,
accuracy1,
accuracy2,
randfact,
fp,
epsil,
nth,
outfile,
outmess,
inmess,
binmess);
break;
case magT:
bin_weights = focusingBP < MagT64 >(K,
patterns,
max_iters,
max_steps,
seed,
damping,
accuracy1,
accuracy2,
randfact,
fp,
epsil,
nth,
outfile,
outmess,
inmess,
binmess);
break;
default: error_magnetization(mag);
break;
}
for (long int i = 0L; i < K; ++i) delete[] bin_weights[i];
delete[] bin_weights;
return 0;
}