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

Improved probing of Connection transform and decoders #671

Merged
merged 4 commits into from
Mar 4, 2015
Merged

Conversation

drasmuss
Copy link
Member

@drasmuss drasmuss commented Mar 2, 2015

Fix for #665 and #667

The only substantive change this makes is that probeable is no longer a Parameter. And I think the only real difference that makes is that you can't use the config system to adjust it. But I think it was always a bit weird to have probeable be a parameter like that. It's really an internal variable, not a model parameter, and I don't think there's any good reason why the user would want to configure it. I would actually be in favour of changing all the other probeable lists to be the same, but I didn't put that in here.

sig = sig[probe.slice]
else:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no way this else was ever being reached, and as far as I can tell indexing slices works fine, so I think this was just left in by accident?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git blame says this was @hunse's doing, so he can comment on it... seems fine to me!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with list indexing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I could tell it did, unless there is some weird indexing method I was missing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So from what I can tell it doesn't work with list indexing:

a = nengo.Ensemble(100, 1)
ap = nengo.Probe(a.neurons[[0, 1, 5]], 'voltage')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be something weird with neurons

a = nengo.Ensemble(10, 3)
p = nengo.Probe(a[[0,2]])

works fine.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because probing an ensemble makes a "connection_probe", as will probing neurons. Since this uses the Connection builder code, which supports advanced slicing, it works fine. It's only when you make a "synapse_probe" (the function in which the line in question is located), for example probing the voltages on neurons, that you run into problems with advanced slicing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah alright, we can put the warning back in then. Or I guess we could implement it, but that seems like more work 😓

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put the exception back in for now.

@tbekolay
Copy link
Member

tbekolay commented Mar 2, 2015

Agreed; probeable makes much more sense as a property. I'd be down for making the other probeables properties too (doesn't have to be this PR though). LGTM!

@tbekolay
Copy link
Member

tbekolay commented Mar 4, 2015

Rebased to master and added commits to make other probeables properties. Also added some short tests to ensure #665 and #667 are fixed.

I think this is ready to merge once #672 is in; @drasmuss, feel free to merge #672 if it looks good to you!

drasmuss and others added 4 commits March 4, 2015 14:10
Similar to previous commit doing this for `Connection`.
It was previously only used for `probeable` attributes, so now there's
no need for them. If other uses come up, we can revive it from the
history.
@tbekolay
Copy link
Member

tbekolay commented Mar 4, 2015

Removed ListParam in 2638892. Merging if these changes are acceptable to @drasmuss!

@drasmuss
Copy link
Member Author

drasmuss commented Mar 4, 2015

looks good!

@tbekolay tbekolay merged commit 6fe0350 into master Mar 4, 2015
@tbekolay tbekolay deleted the probe_fixes branch March 4, 2015 19:18
@hunse hunse mentioned this pull request Mar 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants