Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in bindings SP/Connections print #532

Open
breznak opened this issue Jul 1, 2019 · 4 comments
Open

Bug in bindings SP/Connections print #532

breznak opened this issue Jul 1, 2019 · 4 comments
Labels
bug Something isn't working Python Binding SP

Comments

@breznak
Copy link
Member

breznak commented Jul 1, 2019

Reproduce: create a SP in python with a large number of inputs, print it. The output does not match.

probably some casting/integer overflow bug, either only in the print statement (low bug), or in the SP/Conn parameter.

Output

>>> from htm.bindings.sdr import SDR
>>> sp = SP([1000000],[1000])
>>> print(sp)
Spatial Pooler Connections:
Inputs (17000) ~> Outputs (1000) via Segments (1000)
Segments on Cell Min/Mean/Max 1 / 1 / 1
Potential Synapses on Segment Min/Mean/Max 17 / 17 / 17
Connected Synapses on Segment Min/Mean/Max 2 / 8.507 / 15
Synapses Dead (0%) Saturated (0%)

Inputs above incorrect.

>>> sp = SP([100],[1000])
>>> print(sp)
Spatial Pooler Connections:
Inputs (100) ~> Outputs (1000) via Segments (1000)
Segments on Cell Min/Mean/Max 1 / 1 / 1
Potential Synapses on Segment Min/Mean/Max 17 / 17 / 17
Connected Synapses on Segment Min/Mean/Max 2 / 8.507 / 15
Synapses Dead (0%) Saturated (0%)
@breznak breznak added bug Something isn't working SP Python Binding labels Jul 1, 2019
@ctrl-z-9000-times
Copy link
Collaborator

I think I know why this is happening. The connections object does not know how many presynaptic inputs it has. It infers that number from the synapse data it gets. So if the spatial pooler forms zero connections from an input, then that input will not be counted.

@breznak
Copy link
Member Author

breznak commented Jul 1, 2019

. So if the spatial pooler forms zero connections from an input, then that input will not be counted.

that sounds reasonable. Should just mention in a comment "The number of inputs is infered from input-synapses formed, so it does not have to be exactly the same."

connections object does not know how many presynaptic inputs it has. It infers that number from the synapse data it gets

And let me follow up with a question, are these potential synapses? Ie, if it's not formed initially, it never would later. Or a new segment can be created on uncovered input-space if needed?

If the latter, it's ok, if the former, we should use this to check for some sensible settings. As I can form a SP 100k inputs -> 200 cols. And obviously

Spatial Pooler Connections:
Inputs (3400) ~> Outputs (200) via Segments (200)

which does not seem enough.

@ctrl-z-9000-times
Copy link
Collaborator

The connections object uses potential synapses

@ctrl-z-9000-times
Copy link
Collaborator

check for some sensible settings.

There is an example of checking for sane connections in the branch "columnPooler2" but I don't know how applicable that code is to the Spatial Pooler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Binding SP
Projects
None yet
Development

No branches or pull requests

2 participants