Example usage of Coordinate Encoder

Yes:

Thank you for your prompt and helpful reply. - However
This works:

  inputData = { 'coordinate':[17,37], 'radius':4 }
  base = encoder.encode( inputData )
  print( base )

But this does not work!

  coords = [1,2,3,4,5]
  radius = 4
  base2 = encoder.encodeIntoArray((coords, radius,))
  TypeError: encodeIntoArray() takes exactly 3 arguments (2 given)

I think the problem may lie with my limited understanding of the use of python classes

Also on the topic of the coordinate encoder - Can you point me to any literature on plusses and minuses of different algorithms for encoding neighbors. I am aiming to experiment with anomaly detection in a sequence of coordinates where the sequence may be chaotic. The input is of the form [phi,rho] where both coordinate are in the range 0-2*pi.
I have a working modified coordinate.py which handle the wraparound.

Ok so I ran the uninstall commands for nupic and nupic bindings and got that message for both:

‘cannot uninstall requirement, not installed’

However when I then ran the command you showed me to check the version of nupic and nupic bindings, they still showed up as

nupic 0.5.5
nupic.bindings 0.4.5

Given this should I still just go ahead and

pip install nupic

to upgrade to 1.0?

Hmm when I try to run another nupic run file with a scalar encoder it still runs, so it seems like I haven’t uninstalled nupic then?

No it doesn’t seem like you have. Do you have virtual environments? Or more than one version of python?

I do have more than 1 version of python, yes. I switched the default do both python 2 and python 3 and ran the uninstall files, getting the ‘cannot uninstall requirements, not installed’ messages for both. I can try your other method, of:

rming the nupic.bindings-* files from your site-packages directory.

though I seem to have many site-package directories. Is there a certain file that would be in the right one that would help me pinpoint the right site-packages? I’m really sorry for this laborious hand-holding I’m making you do here :roll_eyes:

Find your site-packages folder(s) and search for any nupic.bindings files or directories. You may need to manually delete them.

Ok I found it! nupic.bindings is within site-packages/nupic/. Should I delete just the bindings folder or the whole nupic folder containing it?

Just delete the whole nupic folder and reinstall.

Ok its gone! I’ve never been so happy to see:

ImportError: No module named nupic

Lol. Now I’ll just simply

pip install nupic

Correct?

Yep :crossed_fingers:

One stupid error in the way! In:

Collecting unittest2==0.5.1 (from nupic)

Any thoughts to get around this?

When I set my default python to python 3 it will import nupic but not nupic bindings, and when I set it to python 2 it wont do either. :thinking:

Hey @rhyolight, any ideas how I might probe next on this? I’ve been poking around without success so far. I’m sorry to pester you in this!

Definitely use python 2, not 3. And try uninstalling unittest2:

pip uninstall unittest2

8 posts were split to a new topic: Debugging CoordinateEncoder issues in NuPIC 1.0

So what’s the verdict?
Is anomaly detection possible with coordinateEncoder in 1.0.1 with any of:

  1. x,y coordinates?
  2. x.y.z coordinates?

If so, what is the corrct syntax to call it?

"Sam, this looks like a bug. Particularly, that CoordinateEncoder has an incomplete implementation in that it does not implement getBucketIndices() as required by the base Encoder superclass. This renders CoordinateEncoder unusable in the OPF, it seems. I’ll write up a bug report"
Has it been solved in 1.0.1?

Yes, for anomaly detection. But there is still now way to decode predictive cells into coordinates, so prediction won’t work.

3 posts were merged into an existing topic: Debugging CoordinateEncoder issues in NuPIC 1.0