org.encog.mathutil.randomize
Class FanInRandomizer
- java.lang.Object
-
- org.encog.mathutil.randomize.BasicRandomizer
-
- org.encog.mathutil.randomize.FanInRandomizer
-
- All Implemented Interfaces:
- Randomizer
public class FanInRandomizer extends BasicRandomizer
A randomizer that attempts to create starting weight values that are conducive to propagation training. This is one of the best randomizers offered in Encog, however, the Nguyen Widrow method generally performs better. From: Neural Networks - A Comprehensive Foundation, Haykin, chapter 6.7
-
-
Constructor Summary
Constructors Constructor and Description FanInRandomizer()Create a fan-in randomizer with default values.FanInRandomizer(double boundary, boolean sqrt)Construct a fan-in randomizer along the specified boundary.FanInRandomizer(double aLowerBound, double anUpperBound, boolean sqrt)Construct a fan-in randomizer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidrandomize(BasicNetwork network, int fromLayer)Randomize one level of a neural network.doublerandomize(double d)Starting with the specified number, randomize it to the degree specified by this randomizer.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(Matrix m)Randomize the matrix based on an array, modify the array.-
Methods inherited from class org.encog.mathutil.randomize.BasicRandomizer
getRandom, nextDouble, nextDouble, randomize, randomize, setRandom
-
-
-
-
Constructor Detail
-
FanInRandomizer
public FanInRandomizer()
Create a fan-in randomizer with default values.
-
FanInRandomizer
public FanInRandomizer(double boundary, boolean sqrt)Construct a fan-in randomizer along the specified boundary. The min will be -boundary and the max will be boundary.- Parameters:
boundary- The boundary for the fan-in.sqrt- Should the square root of the rows to be used in the calculation.
-
FanInRandomizer
public FanInRandomizer(double aLowerBound, double anUpperBound, boolean sqrt)Construct a fan-in randomizer. Use the specified bounds.- Parameters:
aLowerBound- The lower bound.anUpperBound- The upper bound.sqrt- True if the square root of the rows should be used in the calculation.
-
-
Method Detail
-
randomize
public double randomize(double d)
Starting with the specified number, randomize it to the degree specified by this randomizer. This could be a totally new random number, or it could be based on the specified number.- Parameters:
d- The number to randomize.- Returns:
- A randomized number.
-
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- Overrides:
randomizein classBasicRandomizer- Parameters:
d- An array to randomize.
-
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- Overrides:
randomizein classBasicRandomizer- 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- Overrides:
randomizein classBasicRandomizer- Parameters:
m- A matrix to randomize.
-
randomize
public void randomize(BasicNetwork network, int fromLayer)
Randomize one level of a neural network.- Overrides:
randomizein classBasicRandomizer- Parameters:
network- The network to randomizefromLayer- The from level to randomize.
-
-
DMelt 3.0 © DataMelt by jWork.ORG