I try to get running the example nengo > nodes > delaying a connection with a node not just for a nengo.Ensemble but for a spa.State .
So: in earlier versions of the spa I got is running by using this class:
delay_t = 0.2 # 200 ms class Delay(object): def __init__(self, dimensions, timesteps=50): self.timesteps = timesteps self.dimensions = dimensions self.history = None self.reset() def step(self, t, x): self.history = np.roll(self.history, -self.dimensions) self.history[-1] = x return self.history def reset(self): self.history = np.zeros((self.timesteps, self.dimensions)) dt = 0.001 # 1 msec -> see simulations delay = Delay(dimensions = D, timesteps = int(delay_t / dt))
and later within the model:
model.delaynode = nengo.Node(delay.step, size_in=D, size_out=D)
but if I try to use model.delaynode as a spa.State buffer, for example in:
model.input_state >> model.delaynode,
I get an error for this line:
... SpaTypeError: <Connector<Node> (unlabeled) at 0x11cab4be0> was not registered as a SPA input.
I need help:
The problem seems to be, that I do not know, how to transform an array to a spa S-pointer.
Is that correct?
Even if I replace
spa.Transcode(...), I still have with the same problem.