What is wrong with this? (Beginner question)
Steve McCusker
stevemccusker at pobox.com
Wed May 25 10:27:09 UTC 2005
I haven't looked at the Random code in Squeak (or anything else) recently -
stuck in C# for my sins. But it occurs to me that you are perhaps
initialising each random number generator with the same seed, and thus
getting the same sequence of pseudo-random numbers.
Cheers
Steve
> Subject: What is wrong with this? (Beginner question)
> To: <squeak-dev at lists.squeakfoundation.org>
> Message-ID: <200505250214.CWE38339 at mail-router02-eth0.qut.edu.au>
> Content-Type: text/plain; charset="us-ascii"
>
> In the course of implementing a Self-organising feature map (SOM) I needed
> to initialise the weight vecorts of each of nodes in the map with random
> numbers. I wrote the method randomWeights below for the class Som
>
>
> ArrayedCollection variableSubclass: #Som
> instanceVariableNames: 'width height'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'NeuralNets'
>
> randomWeights
>
> "initialise the weights of the neurones to random vectors"
> "JS 5/24/2005 23:14 Caution: all rendome vectors are the same. Why?"
>
> |randomGenerator |
> randomGenerator _ Random new.
> self do: [ :each | 1 to: each size do:
> [:index | each at: index put: randomGenerator next]].
>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 266.11.15 - Release Date: 22/05/2005
More information about the Squeak-dev
mailing list
|