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

Node gets only zero input #54

Open
jgosmann opened this issue Aug 11, 2015 · 4 comments
Open

Node gets only zero input #54

jgosmann opened this issue Aug 11, 2015 · 4 comments

Comments

@jgosmann
Copy link

This script uses a node to probe some data (the output of a circular convolution), but all it gets as input are 0 values. Using a regular probe works fine.

import nengo
import nengo.spa
import nengo_spinnaker
import numpy as np
import matplotlib.pyplot as plt

nengo.log(debug=True)

class Collector(object):
    def __init__(self):
        self.trange = []
        self.data = []

    def __call__(self, t, x):
        self.trange.append(t)
        self.data.append(np.squeeze(x))

d = 10
n_neurons = 50

rng = np.random.RandomState(123)

ctx = nengo.spa.SemanticPointer(d, rng)
ctx.make_unitary()

model = nengo.Network(seed=9023)
with model:
    in_a = nengo.Node(output=nengo.spa.SemanticPointer(d, rng).v)
    in_b = nengo.Node(output=ctx.v)

    cconv = nengo.networks.CircularConvolution(n_neurons, d)
    nengo.Connection(in_a, cconv.A)
    nengo.Connection(in_b, cconv.B)

    probe = Collector()
    probe_node = nengo.Node(probe, size_in=d)
    nengo.Connection(cconv.output, probe_node, synapse=0.01)
    pr = nengo.Probe(cconv.output, synapse=0.01)

    sim = nengo_spinnaker.Simulator(model)
    sim.run(10.)

plt.subplot(2, 1, 1)
plt.plot(probe.trange, probe.data)
plt.subplot(2, 1, 2)
plt.plot(sim.trange(), sim.data[pr])
plt.show()

Plot:
figure_1

@mundya
Copy link
Member

mundya commented Aug 12, 2015

This can be a case of network settings getting in the way, can you use the GUI ok?

@jgosmann
Copy link
Author

Indeed it seems to work in the GUI.

@jgosmann
Copy link
Author

But so does it without now 😮

@jgosmann
Copy link
Author

But it still fails for slightly more complex models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants