You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wanting to run a single simulation a bunch of times, with the same neurons but with random noise that was different between runs. sim.reset() also reset the noise, so I used this workaround:
other_t = np.random.random()
with m:
...
from nengo.utils.functions import whitenoise
noise_func = whitenoise(0.1, 10, .001, dimensions=2)
def func(t):
print other_t
return noise_func(t + other_t)
noisenode = nengo.Node(output=func)
...
sim = nengo.Simulator(m)
for ii in range(50):
sim.reset()
other_t = np.random.random()
sim.run(.75)
So this is mostly just a workaround post in case someone is looking to do this. It would be cool if there was a less hack way to do this as well!
The text was updated successfully, but these errors were encountered:
The issue is that whitenoise generates the input signal when it's called, not at runtime. A straightforward way to do what you want is to change the node function to a whitenoise function with a different seed, reset the simulator, and off you go. #372 allows changing node functions like this.
The simulator now re-makes all `step` functions on a reset, which
should reset all operators. Fixes#616.
The simulator seed (currently only used by Processes, I think) can
be changed when calling `Simulator.reset`. Fixes#582.
The simulator now re-makes all `step` functions on a reset, which
should reset all operators. Fixes#616.
The simulator seed (currently only used by Processes, I think) can
be changed when calling `Simulator.reset`. Fixes#582.
I was wanting to run a single simulation a bunch of times, with the same neurons but with random noise that was different between runs.
sim.reset()
also reset the noise, so I used this workaround:So this is mostly just a workaround post in case someone is looking to do this. It would be cool if there was a less hack way to do this as well!
The text was updated successfully, but these errors were encountered: