nengo / nengo-loihi

Run Nengo models on Intel's Loihi chip
https://www.nengo.ai/nengo-loihi/
Other
35 stars 12 forks source link

Range of output values from ensemble on chip unexpectedly limited #294

Open studywolf opened 4 years ago

studywolf commented 4 years ago

is there any documentation on limits of the output value range from ensembles running on loihi?

import matplotlib.pyplot as plt
import numpy as np
import nengo
import nengo_loihi
with nengo.Network() as net:
    nengo_loihi.add_params(net)
    ens = nengo.Ensemble(1000, 1)
    node = nengo.Node(size_in=2)
    input = nengo.Node(np.cos)
    nengo.Connection(input, ens)
    nengo.Connection(ens, node[0], function=lambda x: x**2, transform=20)
    nengo.Connection(ens, node[1], function=lambda x: 20 * x**2)
    probe = nengo.Probe(node, synapse=0.005)
plt.subplot(2, 1, 1)
with nengo.Simulator(net) as sim:
    sim.run(2*np.pi)
plt.plot(sim.trange(), sim.data[probe][:, 0])
plt.plot(sim.trange(), sim.data[probe][:, 1], '--')
plt.subplot(2, 1, 2)
with nengo_loihi.Simulator(net) as sim:
    sim.run(2*np.pi)
plt.plot(sim.trange(), sim.data[probe][:, 0])
plt.plot(sim.trange(), sim.data[probe][:, 1], '--')
plt.show()

maybe a warning for the user? or something like sampling the function and setting the DecodeNeurons radius off of that?