This file contains 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
version | value | |
---|---|---|
0.1 | 1 | |
0.1 | 1.257 | |
0.2 | 2 | |
0.2 | 1.3 |
This file contains 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
// Using SFML as out audio loader and player | |
#include <SFML/Audio.hpp> | |
// The standard headers we need | |
#include <iostream> | |
#include <thread> | |
#include <chrono> | |
#include <stdexcept> | |
#include <memory> | |
#include <cassert> |
This file contains 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
//Released under BSD-3 Cluse licsence | |
//How to run: root -b stackedsp.cpp | |
//or: c++ stackedsp.cpp -o stackedsp -O3 -lEtaler `root-config --cflags --ldflags --glibs` && ./stackedsp | |
//Assuming you have Etaler installed in /use/local/lib. Change this if you have it in other places | |
#pragma cling load("/usr/local/lib/libEtaler.so") | |
#include <Etaler/Etaler.hpp> | |
#include <Etaler/Algorithms/SpatialPooler.hpp> | |
#include <Etaler/Encoders/GridCell1d.hpp> | |
#include <Etaler/Encoders/Scalar.hpp> | |
using namespace et; |
This file contains 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
The Meson build system | |
Version: 0.50.1 | |
Source dir: /home/marty/Documents/phosh2 | |
Build dir: /home/marty/Documents/phosh2/_build | |
Build type: native build | |
Project name: phosh | |
Project version: 0.0.2 | |
Native C compiler: cc (gcc 8.3.0 "cc (GCC) 8.3.0") | |
Build machine cpu family: x86_64 | |
Build machine cpu: x86_64 |
This file contains 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
The Meson build system | |
Version: 0.50.1 | |
Source dir: /home/marty/Documents/phosh | |
Build dir: /home/marty/Documents/phosh/_build | |
Build type: native build | |
Project name: phosh | |
Project version: 0.0.2 | |
Native C compiler: cc (gcc 8.3.0 "cc (GCC) 8.3.0") | |
Build machine cpu family: x86_64 | |
Build machine cpu: x86_64 |
This file contains 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
Directory already configured. | |
Just run your build command (e.g. ninja) and Meson will regenerate as necessary. | |
If ninja fails, run "ninja reconfigure" or "meson --reconfigure" | |
to force Meson to regenerate. | |
If build failures persist, run "meson setup --wipe" to rebuild from scratch | |
using the same options as passed when configuring the build. | |
To change option values, run "meson configure" instead. | |
ninja: Entering directory `_build' |
This file contains 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
inline size_t unfoldIndex(const std::vector<size_t>& index, const std::vector<size_t>& shape) noexcept | |
{ | |
size_t s = 0; | |
size_t v = 1; | |
assert(index.size() == shape.size()); | |
for(int i=(int)index.size()-1;i>=0;i--) { | |
v *= (i==(int)index.size()-1?1:shape[i+1]); | |
s += index[i] * v; | |
} |
This file contains 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
inline xt::xarray<uint16_t> load_image(std::string path) | |
{ | |
std::ifstream in(path); | |
xt::xarray<int> arr = xt::load_csv<int>(in); | |
in.close(); | |
//Image padding | |
xt::xarray<int> resized_image = xt::zeros<int>({arr.shape()[0]+2, arr.shape()[1]+1}); | |
xt::view(resized_image, xt::range(1, arr.shape()[0]+1), xt::range(1, arr.shape()[1]+1)) = arr; |
This file contains 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}; |