org.neuroph.util.random
Class WeightsRandomizer

java.lang.Object
  extended by org.neuroph.util.random.WeightsRandomizer
Direct Known Subclasses:
DistortRandomizer, GaussianRandomizer, RangeRandomizer

public class WeightsRandomizer
extends Object

Basic weights randomizer, iterates and randomizes all connection weights in network.

Author:
Zoran Sevarac

Field Summary
protected  Random randomGenerator
          Random number genarator used by randomizers
 
Constructor Summary
WeightsRandomizer()
          Create a new instance of WeightsRandomizer
WeightsRandomizer(Random randomGenerator)
          Create a new instance of WeightsRandomizer with specified random generator If you use the same random generators, you'll get the same random sequences
 
Method Summary
 Random getRandomGenerator()
          Gets random generator used to generate random values
protected  double nextRandomWeight()
          Returns next random value from random generator, that will be used to initialize weight
 void randomize(NeuralNetwork neuralNetwork)
          Iterate all layers, neurons and connections in network, and randomize connection weights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

randomGenerator

protected Random randomGenerator
Random number genarator used by randomizers

Constructor Detail

WeightsRandomizer

public WeightsRandomizer()
Create a new instance of WeightsRandomizer


WeightsRandomizer

public WeightsRandomizer(Random randomGenerator)
Create a new instance of WeightsRandomizer with specified random generator If you use the same random generators, you'll get the same random sequences

Parameters:
randomGenerator - random geneartor to use for randomizing weights
Method Detail

getRandomGenerator

public Random getRandomGenerator()
Gets random generator used to generate random values

Returns:
random generator used to generate random values

randomize

public void randomize(NeuralNetwork neuralNetwork)
Iterate all layers, neurons and connections in network, and randomize connection weights

Parameters:
neuralNetwork - neural network to randomize

nextRandomWeight

protected double nextRandomWeight()
Returns next random value from random generator, that will be used to initialize weight

Returns:
next random value fro random generator


Copyright © 2012. All Rights Reserved.