|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.joone.engine.weights.FanInBasedWeightInitializer
public class FanInBasedWeightInitializer
The weights are uniformly distributed (that is randomly) within the range [LB/F_i, UB/F_i]
.
LB
and UB
stand for lower bound and upper bound,
which is a certain number. Here the bounds will be by default -2.4 and 2.4 as described
in Neural Networks - A Comprehensive Foundation, Haykin, chapter 6.7 Some Hints
for Making the Back-Propagation Algorithm Perform Better. F_i
is the fan-in,
i.e. the total number of inputs) of neuron i. There is also an option to use instead of
F_i
the square root of F_i
, which is also used in some cases.
Constructor Summary | |
---|---|
FanInBasedWeightInitializer()
Creates a new instance of FanInBasedWeightInitializer. |
|
FanInBasedWeightInitializer(double aBoundary)
Creates a new instance of FanInBasedWeightInitializer. |
|
FanInBasedWeightInitializer(double aLowerBound,
double anUpperBound)
Creates a new instance of FanInBasedWeightInitializer |
Method Summary | |
---|---|
double |
getLowerBound()
Gets the lower bound. |
double |
getUpperBound()
Gets the upper bound. |
void |
initialize(Matrix aMatrix)
Initializes weights (biases) represented by the matrix. |
boolean |
isSqrtFanIn()
Checks if the mode of the fan-in is the square root mode, i.e. |
void |
setLowerBound(double aLowerBound)
Sets the lower bound. |
void |
setSqrtFanIn(boolean aMode)
Sets the flag indicating the mode of the fan-in to use. |
void |
setUpperBound(double anUpperBound)
Sets the upper bound. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FanInBasedWeightInitializer()
public FanInBasedWeightInitializer(double aBoundary)
aBoundary
- the boundary to use to init the weights
([-aBoundary/F_i, aBoundary/F_i]
, where F_i
is
the fan-in of neuron i.public FanInBasedWeightInitializer(double aLowerBound, double anUpperBound)
aLowerBound
- the lower boundary to use divided by the fan-in of a neuron.anUpperBound
- the upper boundary to use divided by the fan-in of a neuron.Method Detail |
---|
public void initialize(Matrix aMatrix)
WeightInitializer
initialize
in interface WeightInitializer
aMatrix
- the weights (biases) to be initialized.public void setSqrtFanIn(boolean aMode)
true
the square root of the fan-in will be used, otherwise
the normal fan-in will be used (default mode).
aMode
- the mode to use, true
for the square root of
the fan-in, false
for the normal fan-in.public boolean isSqrtFanIn()
public double getLowerBound()
public void setLowerBound(double aLowerBound)
aLowerBound
- the new lower bound.public double getUpperBound()
public void setUpperBound(double anUpperBound)
anUpperBound
- the new upper bound.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |