org.encog.mathutil.randomize
Class BasicRandomizer
- java.lang.Object
-
- org.encog.mathutil.randomize.BasicRandomizer
-
- All Implemented Interfaces:
- Randomizer
- Direct Known Subclasses:
- ConsistentRandomizer, ConstRandomizer, Distort, FanInRandomizer, GaussianRandomizer, NguyenWidrowRandomizer, RangeRandomizer
public abstract class BasicRandomizer extends java.lang.Object implements Randomizer
Provides basic functionality that most randomizers will need.
-
-
Constructor Summary
Constructors Constructor and Description BasicRandomizer()Construct a random number generator with a random(current time) seed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description GenerateRandomgetRandom()doublenextDouble()doublenextDouble(double min, double max)Generate a random number in the specified range.voidrandomize(BasicNetwork network, int fromLayer)Randomize one level of a neural network.voidrandomize(double[] d)Randomize the array based on an array, modify the array.voidrandomize(double[][] d)Randomize the 2d array based on an array, modify the array.voidrandomize(double[] d, int begin, int size)Randomize the array based on an array, modify the array.voidrandomize(Matrix m)Randomize the matrix based on an array, modify the array.voidrandomize(MLMethod method)Randomize the synapses and biases in the basic network based on an array, modify the array.voidsetRandom(GenerateRandom theRandom)Explicitly set the Random source-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.encog.mathutil.randomize.Randomizer
randomize
-
-
-
-
Constructor Detail
-
BasicRandomizer
public BasicRandomizer()
Construct a random number generator with a random(current time) seed. If you want to set your own seed, just call "getRandom().setSeed".
-
-
Method Detail
-
getRandom
public final GenerateRandom getRandom()
- Specified by:
getRandomin interfaceRandomizer- Returns:
- The random number generator in use. Use this to set the seed, if desired.
-
nextDouble
public final double nextDouble()
- Returns:
- The next double.
-
nextDouble
public final double nextDouble(double min, double max)Generate a random number in the specified range.- Parameters:
min- The minimum value.max- The maximum value.- Returns:
- A random number.
-
randomize
public void randomize(BasicNetwork network, int fromLayer)
Randomize one level of a neural network.- Parameters:
network- The network to randomizefromLayer- The from level to randomize.
-
randomize
public void randomize(double[] d)
Randomize the array based on an array, modify the array. Previous values may be used, or they may be discarded, depending on the randomizer.- Specified by:
randomizein interfaceRandomizer- Parameters:
d- An array to randomize.
-
randomize
public void randomize(double[] d, int begin, int size)Randomize the array based on an array, modify the array. Previous values may be used, or they may be discarded, depending on the randomizer.- Specified by:
randomizein interfaceRandomizer- Parameters:
d- An array to randomize.begin- The beginning element of the array.size- The size of the array to copy.
-
randomize
public void randomize(double[][] d)
Randomize the 2d array based on an array, modify the array. Previous values may be used, or they may be discarded, depending on the randomizer.- Specified by:
randomizein interfaceRandomizer- Parameters:
d- An array to randomize.
-
randomize
public void randomize(Matrix m)
Randomize the matrix based on an array, modify the array. Previous values may be used, or they may be discarded, depending on the randomizer.- Specified by:
randomizein interfaceRandomizer- Parameters:
m- A matrix to randomize.
-
randomize
public void randomize(MLMethod method)
Randomize the synapses and biases in the basic network based on an array, modify the array. Previous values may be used, or they may be discarded, depending on the randomizer.- Specified by:
randomizein interfaceRandomizer- Parameters:
method- A network to randomize.
-
setRandom
public final void setRandom(GenerateRandom theRandom)
Description copied from interface:RandomizerExplicitly set the Random source- Specified by:
setRandomin interfaceRandomizer- Parameters:
theRandom- the random to set
-
-
DMelt 3.0 © DataMelt by jWork.ORG