Inconsistent results in spa-binding example


#1

Hi -

When I reproduce the spa-binding example from the tutorials, often the semantic cloud for ‘C’ (i.e. A * B) only shows the value of A, sometimes a strong A and a weak B. I have varied the physical size of the semantic clouds & sometimes that seems to make a difference - although that makes no sense to me. Sometimes if I reboot nengo I get a result closer to the cloud for C showing A and B. ?? different results at different times of the day or with different computers.

I have varied the number of dimensions and that does not seem to make a difference.

What am I missing?


#2

The inconsistencies that you’re seeing are a core part of how Nengo works. We randomly generate many parts of a model because 1) neuron properties usually need to be heterogeneous to represent and transform information well, 2) it’s tedious to manually define all of the properties of all neurons, 3) we often don’t know what values would be correct for the brain area being modeled (much less the individual being modeled), and 4) it enables us to make many instantiations of the same underlying model to do experiments on the whole population.

If, however, you want your model to operate deterministically, you can either manually specify all the properties of the neurons (this would be a lot of work) or you can set the random number seed on the network. Both spa.SPA and nengo.Network accept a seed argument that will result in the model giving the same results every time you run them (as long as you’re not introducing some additional randomness outside the model). In that example, I believe you would change the line

model = nengo.Network()

to

model = nengo.Network(seed=0)

Vary the seed number to see different results.

PS: Your observation that you get different results at different times of day or with different computers is correct because the default random seed is generated partly based on the system clock :wink:


#3

thanks so much