Creating random weights with realistic value

Hi all,

I want to create a connection with random weights between a pre and post ensemble, a learning rule will be applied to this connection so that it will train to be meaningfull (instead of random). How can I create a random weight matrix whose values are of a realistic value. Meaning, similar in size/value to the weight calculated for the identity function? Or is it possible to specifiy the function as random for a connection?

Kind regards,


Hi @ChielWijs,

There are multiple ways of setting a connection weight matrix to be random. The easiest way is to do something like in this example, and that is to provide the connection with a function that just spits out random samples instead of using the default identity function:

nengo.Connection(pre, post, function=lambda x: np.random.random(post.dimensions))