Skip to main content

A high performance implementation of Numenta's HTM algorithms

Project description

PyEtaler

This is the offical Python binding for Etaler. PyEtaler generates Python binging using cppyy and adds additional feature on top of the automatically generated bindings.

Note: As of now, installing cppyy (thus PyEtaler) will cause ROOT to fail to load due to dependency clash.

Building from source

Installation

Note: You must have Etaler and cppyy installed globally before building the binding. Note: Since the binding is generated to load the actual Etaler installation. You'll need to re-compile the binding everytime Etaler is updated.

If you are building from source (building via directlt interacting with the generator).

pip install cppyy # must installed globally
python3 genbinding.py
cp *.so etaler/
cp *.pcm etaler/
# Then copy the resulting files into your package directory

Locally build via PIP

pip3 install .

Alternativelly you can install it directly via PyPI.

pip install pyetaler

Usage

After installation, you can use Etaler from python. The API is exactly like it is in C++.

>>> from etaler import et
>>> et.ones([2, 2])
{{ 1, 1}, 
 { 1, 1}}
>>> sp = et.SpatialPooler([128], [32])
>>> x = et.encoder.scalar(0.1, 0, 1, 128, 12)
>>> sp.compute(x)
{ 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}

Hacking PyEtaler

In case that you need to use C++ STL - maybe because the wrapper is doing something stupid. You can access the STL using etaler.std.

For example

>>> from etaler import std
>>> std.vector[int](10)
<cppyy.gbl.std.vector<int> object at 0x1ef112c0>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyetaler-0.0.3.tar.gz (3.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page