Created
February 1, 2019 15:09
-
-
Save marty1885/42b6b96c75335b86bd067a1a53bda224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "HTMHelper.hpp" | |
using namespace HTM; | |
int main() | |
{ | |
TemporalMemory tm({16}, 8); | |
CategoryEncoder encoder(2, 8); | |
std::vector<size_t> seq = {0,0,1,1}; | |
for(size_t i=0;i<6400;i++) { | |
auto res = tm.compute(encoder.encode(seq[i%seq.size()]), true); | |
auto cat = encoder.decode(res); | |
if(cat.size() != 0) | |
std::cout << cat[0] << '\n'; | |
else | |
std::cout << "None" << '\n'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment