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

Probing Connections #973

Closed
youssefzaky opened this issue Mar 2, 2016 · 4 comments
Closed

Probing Connections #973

youssefzaky opened this issue Mar 2, 2016 · 4 comments
Labels
Milestone

Comments

@youssefzaky
Copy link
Contributor

It appears that a probe on a connection returns the output of the post object rather than just the signal from that connection. So if you have multiple inputs going into an object, the connection probes on each return the sum of all the inputs, not the signal going through each connection.

In the following example all the probes show the same value.

import nengo
import matplotlib.pyplot as plt

with nengo.Network() as model:
    input = nengo.Node(output=1)
    ens1 = nengo.Ensemble(dimensions=1, n_neurons=100)
    ens2 = nengo.Ensemble(dimensions=1, n_neurons=100)
    ens3 = nengo.Ensemble(dimensions=1, n_neurons=100, radius=1)
    nengo.Connection(input, ens1)
    nengo.Connection(input, ens2)
    c1 = nengo.Connection(ens1, ens3, transform=2)
    c2 = nengo.Connection(ens2, ens3, transform=-1)
    p1 = nengo.Probe(c1, synapse=0.05)
    p2 = nengo.Probe(c2, synapse=0.05)
    p3 = nengo.Probe(ens3, synapse=0.05)

s = nengo.Simulator(model)
s.run(1)
plt.plot(s.trange(), s.data[p1], label='conn1')
plt.plot(s.trange(), s.data[p2], label='conn2')
plt.plot(s.trange(), s.data[p3], label='ens')
plt.legend(loc='best')
plt.ylim(-2, 2)
plt.show()
@youssefzaky youssefzaky added the bug label Mar 2, 2016
@tbekolay
Copy link
Member

tbekolay commented Mar 2, 2016

Does doing

    p1 = nengo.Probe(c1, 'input', synapse=0.05)
    p2 = nengo.Probe(c2, 'input', synapse=0.05)

Give you what you want? By default, probing a connection probes the 'output' attribute.

@youssefzaky
Copy link
Contributor Author

I thought probing the 'output' attribute on p1 and p2 would show values of 2 and -1 respectively. Probing 'input' attribute gives 100D values (the inputs from each presynaptic neuron?)

@hunse
Copy link
Collaborator

hunse commented Mar 2, 2016

Does #974 do what you want?

@tbekolay tbekolay added this to the 2.1.0 release milestone Mar 2, 2016
@youssefzaky
Copy link
Contributor Author

yup!

tbekolay pushed a commit that referenced this issue Mar 16, 2016
tbekolay pushed a commit that referenced this issue Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants