Documentation of 'org.joone.engine.weights.FanInBasedWeightInitializer' Java class
FanInBasedWeightInitializer
org.joone.engine.weights

Class FanInBasedWeightInitializer

  • All Implemented Interfaces:
    java.io.Serializable, WeightInitializer


    public class FanInBasedWeightInitializer
    extends java.lang.Object
    implements WeightInitializer
    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.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FanInBasedWeightInitializer

        public FanInBasedWeightInitializer()
        Creates a new instance of FanInBasedWeightInitializer. It uses it default values +/- 2.4 for the bounds and the normal fan-in.
      • FanInBasedWeightInitializer

        public FanInBasedWeightInitializer(double aBoundary)
        Creates a new instance of FanInBasedWeightInitializer.
        Parameters:
        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.
      • FanInBasedWeightInitializer

        public FanInBasedWeightInitializer(double aLowerBound,
                                           double anUpperBound)
        Creates a new instance of FanInBasedWeightInitializer
        Parameters:
        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

      • initialize

        public void initialize(Matrix aMatrix)
        Description copied from interface: WeightInitializer
        Initializes weights (biases) represented by the matrix.
        Specified by:
        initialize in interface WeightInitializer
        Parameters:
        aMatrix - the weights (biases) to be initialized.
      • setSqrtFanIn

        public void setSqrtFanIn(boolean aMode)
        Sets the flag indicating the mode of the fan-in to use. If set to true the square root of the fan-in will be used, otherwise the normal fan-in will be used (default mode).
        Parameters:
        aMode - the mode to use, true for the square root of the fan-in, false for the normal fan-in.
      • isSqrtFanIn

        public boolean isSqrtFanIn()
        Checks if the mode of the fan-in is the square root mode, i.e. the square root of the fan-in is used or if the normal mode, i.e. the normal fan-in is used.
        Returns:
        true if the square root of the fan-in is used, false otherwise.
      • getLowerBound

        public double getLowerBound()
        Gets the lower bound.
        Returns:
        the lower bound.
      • setLowerBound

        public void setLowerBound(double aLowerBound)
        Sets the lower bound.
        Parameters:
        aLowerBound - the new lower bound.
      • getUpperBound

        public double getUpperBound()
        Gets the upper bound.
        Returns:
        the upper bound.
      • setUpperBound

        public void setUpperBound(double anUpperBound)
        Sets the upper bound.
        Parameters:
        anUpperBound - the new upper bound.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.