@@ -38,13 +38,12 @@ int main(int argc, char* argv[]) {
38
38
std::ofstream ofs;
39
39
40
40
std::string encoder_params = " {size: " + std::to_string (DIM_INPUT) + " , activeBits: 4, radius: 0.5, seed: 2019 }" ;
41
- // std::string sp_local_params = "{columnCount: " + std::to_string(COLS) + "}";
42
41
std::string sp_global_params = " {columnCount: " + std::to_string (COLS) + " , globalInhibition: true}" ;
43
42
std::string tm_params = " {activationThreshold: 9, cellsPerColumn: " + std::to_string (CELLS) + " }" ;
44
43
45
44
// Runtime arguments: napi_sine [epochs [filename]]
46
45
if (argc >= 2 ) {
47
- EPOCHS = std::stoi (argv[1 ]); // number of iterations (default 500 )
46
+ EPOCHS = std::stoi (argv[1 ]); // number of iterations (default 5000 )
48
47
}
49
48
if (argc >= 3 ) {
50
49
ofs.open (argv[2 ], std::ios::out); // output filename (for plotting)
@@ -58,36 +57,34 @@ int main(int argc, char* argv[]) {
58
57
59
58
// Declare the regions to use
60
59
std::shared_ptr<Region> encoder = net.addRegion (" encoder" , " RDSERegion" , encoder_params);
61
- // std::shared_ptr<Region> sp_local = net.addRegion("sp_local", "SPRegion", sp_local_params);
62
60
std::shared_ptr<Region> sp_global = net.addRegion (" sp_global" , " SPRegion" , sp_global_params);
63
61
std::shared_ptr<Region> tm = net.addRegion (" tm" , " TMRegion" , tm_params);
64
62
65
63
// Setup data flows between regions
66
- // net.link("encoder", "sp_local", "", "", "encoded", "bottomUpIn");
67
64
net.link (" encoder" , " sp_global" , " " , " " , " encoded" , " bottomUpIn" );
68
65
net.link (" sp_global" , " tm" , " " , " " , " bottomUpOut" , " bottomUpIn" );
69
66
70
67
net.initialize ();
71
68
72
69
// /////////////////////////////////////////////////////////////
73
70
//
74
- // .-- ----------------.
75
- // | encoder |
76
- // data--->| (RDSERegion) |
77
- // | |
78
- // `- -----------------'
79
- // | |
80
- // .------------------. .- -----------------.
81
- // | sp_local | | sp_global |
82
- // | (SPRegion) | | (SPRegion) |
83
- // | | | |
84
- // `------------------' `- -----------------'
85
- // |
86
- // .- -----------------.
87
- // | tm |
88
- // | (TMRegion) |
89
- // | |
90
- // `- -----------------'
71
+ // . ----------------.
72
+ // | encoder |
73
+ // data--->| (RDSERegion) |
74
+ // | |
75
+ // ` -----------------'
76
+ // |
77
+ // . -----------------.
78
+ // | sp_global |
79
+ // | (SPRegion) |
80
+ // | |
81
+ // ` -----------------'
82
+ // |
83
+ // . -----------------.
84
+ // | tm |
85
+ // | (TMRegion) |
86
+ // | |
87
+ // ` -----------------'
91
88
//
92
89
// ////////////////////////////////////////////////////////////////
93
90
@@ -111,7 +108,6 @@ int main(int argc, char* argv[]) {
111
108
VERBOSE << " Epoch = " << i << std::endl;
112
109
VERBOSE << " Data = " << data << std::endl;
113
110
VERBOSE << " Encoder out = " << encoder->getOutputData (" encoded" ).getSDR ();
114
- // VERBOSE << " SP (local) = " << sp_local->getOutputData("bottomUpOut").getSDR();
115
111
VERBOSE << " SP (global) = " << sp_global->getOutputData (" bottomUpOut" ).getSDR ();
116
112
VERBOSE << " TM output = " << tm ->getOutputData (" bottomUpOut" ).getSDR ();
117
113
VERBOSE << " ActiveCells = " << tm ->getOutputData (" activeCells" ).getSDR ();
0 commit comments