RandomizeNet(): Any way to specify Random Number Seed?

Have specific questions about how to work with certain MemBrain features? Not sure about which checkbox in MemBrain has which effects? Want to know if a certain functionality is available in MemBrain or not?

Your questions will be appreciated here!
Post Reply
MrCreosote
Posts: 55
Joined: Wed 21. Jul 2010, 18:43

RandomizeNet(): Any way to specify Random Number Seed?

Post by MrCreosote »

I know that my model is very sensitive to initialization and during all my learning exercises, I keep getting the same answer which suggests that random number seed is not specified and allowed to default when RandomizeNet() is called.

I was hoping that if RandomizeNet() was called repeatedly, the random number seed would increment, but I don't think it does.

Any way to achieve random number seed control? (If MemBrain uses a Windows call for randomization, perhaps it would be possible to change the seed default in Windows?) (Obviously, seed# would be a perfect argument for RandomizeNet() )

Thanks
Tom
User avatar
Admin
Site Admin
Posts: 438
Joined: Sun 16. Nov 2008, 18:21

Re: RandomizeNet(): Any way to specify Random Number Seed?

Post by Admin »

You are right, the seed for the random currently can not be specified. When MemBrain is started the seed is taken from the system time.

I'll consider adding this in some future version, it might be a good improvement.

As a work-around: After randomizing the net you certainly can save the net in that randomized state and then do not again randomize before to start the training. That way you will always have the same initial net before the training is started.

Regards,
Thomas
Thomas Jetter
MrCreosote
Posts: 55
Joined: Wed 21. Jul 2010, 18:43

Re: RandomizeNet(): Any way to specify Random Number Seed?

Post by MrCreosote »

NOTE: I'm completely editing this post based on recent test cases. The original contents of this reply will be available at the end for reference purposes.

RandomizeNet() generates a set of initial weights based on a random seed each time it is called. This means you cannot reproduce sets of weights produced by repeated calls of RandomizeNet() even if you start from the same initial set of weights.

If you want a repeatable set of weights, simply repeat: RN() and Save Network as many times as desired. When you reload the network, you will have the weights that were present when it was saved.

This can be done during a single session of MemBrain.

If you are trying many solution methods and want a direct comparison starting from the same initial weights, save the network after you first RandomizeNet(). Then recall that network every time you try another solution attempt.

NOTE: One verification of a network is to show that it is not sensitive to initial weights. If the method is to try 20 initial weight sets, it may not be that important that the same 20 random number seeds are used for every verification. Any 20 random sets is probably "random enough" for comparison.


________________________________
ORIGINAL REPLY:

OK, so if I want to study sensitivity to randomization by comparing 20 different randomizations, this would work:

GENERATE SET OF RANDOMIZATIONS:

Open Membrain, Randomize, Save Net as RNS01 (Random Number Seed 01), Close Membrain.
Open Membrain, Randomize, Save Net as RNS02 (Random Number Seed 02), Close Membrain.
...
Open Membrain, Randomize, Save Net as RNS20 (Random Number Seed 20), Close Membrain.
__________________________

Keep these randomizations for all future analysis.

To obtain the desired randomization, simply reload the appropriate RNSxx network.
User avatar
Admin
Site Admin
Posts: 438
Joined: Sun 16. Nov 2008, 18:21

Re: RandomizeNet(): Any way to specify Random Number Seed?

Post by Admin »

MrCreosote wrote:Open Membrain, Randomize, Save Net as RNS01 (Random Number Seed 01), Close Membrain.
I don't see any reason why you would have to close MemBrain in between the randomize/save actions.

Regards,
Thomas
Thomas Jetter
Post Reply