Dear Nengo team,
While updating a software from Ubuntu 16 to Ubuntu 18, I have noticed that Nengo runs significantly slower on Ubuntu 18 (up to twice as slow). To be precise, I computed the average time taken by a call to the function run.step() on a simple model (1 ensemble with 1000 neurons), and I obtained an average time of 0.14 ms in Ubuntu 16 and 0.24 in Ubuntu 18.
Is this something that you are aware of? Can I do something to improve Nengo speed on my Ubuntu 18?
Thanks
Alexis
###################################
script used for benchmarking
import nengo
import time
circuit = nengo.Network()
with circuit:
inpt = nengo.Node([.5]*3)
sensors = nengo.Ensemble(n_neurons=1000, dimensions=3)
actors = nengo.Ensemble(n_neurons=2, dimensions=2, neuron_type=nengo.Direct())
def control(x):
rl, rr, gb = x
forward = min(1.0, max(-0.01, (min(rl, rr)) * 100000))
turn = max(min((rl - rr) * 100, 1), -1)
if max(rl, rr) < 0.1:
forward = -0.001
turn = 0.5
return forward, turn
nengo.Connection(inpt, sensors)
nengo.Connection(sensors, actors, function=control, synapse=0.1)
avg = 0
with nengo.Simulator(circuit) as sim:
for i in range(1000):
start = time.time()
sim.step()
end = time.time()
avg += end - start
print("avg time for a sim.step() call (in ms):", avg)