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

Non-deterministic behaviour despite seed being set. #1275

Closed
jgosmann opened this issue Mar 6, 2017 · 2 comments
Closed

Non-deterministic behaviour despite seed being set. #1275

jgosmann opened this issue Mar 6, 2017 · 2 comments
Labels

Comments

@jgosmann
Copy link
Collaborator

jgosmann commented Mar 6, 2017

Using Nengo 2.3.1 the following will produce different results for a and b despite fixed seed:

import nengo
import numpy as np

with nengo.Network(1) as model:
    ens = nengo.Ensemble(10, 1)
    inp = nengo.Node(np.sin)
    nengo.Connection(inp, ens)
    p = nengo.Probe(ens.neurons, 'spikes')

with nengo.Simulator(model) as sim:
    sim.run(.01)

a = sim.data[p]

with nengo.Simulator(model) as sim:
    sim.run(.01)

b = sim.data[p]

Example output for a:

array([[    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,  1000.,     0.,     0.,
            0.,  1000.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,  1000.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.]])

and b:

array([[    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,  1000.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [ 1000.,     0.,     0.,  1000.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,  1000.,     0.,  1000.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,  1000.,     0.,     0.,     0.,     0.,     0.,     0.,
            0.,     0.],
       [    0.,     0.,     0.,  1000.,     0.,     0.,     0.,     0.,
            0.,     0.]])
@jgosmann jgosmann added the bug label Mar 6, 2017
@jgosmann
Copy link
Collaborator Author

jgosmann commented Mar 6, 2017

Seems to affect all Nengo versions since 2.0.0 and occurs with Python 2 and 3.

@jgosmann
Copy link
Collaborator Author

jgosmann commented Mar 6, 2017

@tcstewar just told me that the first argument to Network is the label and not the seed. 😵
Sorry, for the spam and I guess I need a break.

@jgosmann jgosmann closed this as completed Mar 6, 2017
jgosmann added a commit that referenced this issue Mar 8, 2017
This helps issues like #1275 where one accidentally sets the label instead
of the seed.
tbekolay pushed a commit that referenced this issue Mar 10, 2017
This helps situations where one accidentally sets the label instead
of the seed (see for example #1275).
adityagilra pushed a commit to adityagilra/nengo that referenced this issue Jun 21, 2017
This helps situations where one accidentally sets the label instead
of the seed (see for example nengo#1275).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant