Run examples of low-level code in htm.core

Hi to all. I’m looking for examples of low-level code in htm.core or Nupic. My goal is to access SP and TM directly. And be able to see the input and output of SP.compute(input, learning, output). I’m very interested in getting sp.compute() input and output for the NYCTaxi database. Please help me. So far, I’ve been able to run hot gym and MNIST database code in htm.core. Please help me find and execute other code.
Thank you very much

2 Likes

Hey @katrin, have you seen the ‘hello_sp.py’ and ‘hello_tm.py’ files in the htm.core repo? They show how sp & tm modules are called.

By ‘other code’ do you mean other existing examples? Or do you have your own data you’d like to run?

hi @sheiser1
Thanks for your explanation, Yes, I saw this example.
I meant that I am looking to run the existing examples, and I want to have the input and output vectors in the SP algorithm, that is, the two vectors in the sp .compute(). For example, I want to get the input and output vectors of the SP algorithm in the NYCTaxi database.
Would you please help me?

Is there a code for the NYC-taxi database in htm.core? What are the input and output vectors of the SP algorithm?

Are you asking to ‘debug’ the running of SP and inspect variables into the calls to sp.compute()?
The API for the compute call is documented if you just want to understand its function.

To run the NYC-taxi dataset, you will need an encoder function for this dataset (to encode it into an SDR). I am sure one exists already under the NAB code somewhere but I can’t find it.

Hey @katrin,

I’ll show you how I call the SP & TM in my code:

The input vector to SP is encoding & the output is active_columns.
Encoding is a relatively small & dense vector generated by the RDSE from the raw data (features_data), and active_columns is the larger & sparser vector that goes in TM.

I think before you can wield the SP for the Taxi data (or any data) you need to get comfortable generating encodings from the raw inputs, since only then you’ll have valid inputs to SP. Have you done this yet? Let me know where we should start.

So NAB using RDSE by default does it? Good to know.

thanks

Yes to my knowledge its RDSE plus DateTime encodings used in all NAB real data sets. Though this code I showed isn’t form NAB

1 Like