Class ExponentialDecayFunction

java.lang.Object
org.apache.commons.math3.ml.neuralnet.sofm.util.ExponentialDecayFunction

public class ExponentialDecayFunction extends Object
Exponential decay function: a e-x / b, where x is the (integer) independent variable.
Class is immutable.
Since:
3.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
    Factor a.
    private final double
    Factor 1 / b.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExponentialDecayFunction(double initValue, double valueAtNumCall, long numCall)
    Creates an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    value(long numCall)
    Computes a e-numCall / b.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • a

      private final double a
      Factor a.
    • oneOverB

      private final double oneOverB
      Factor 1 / b.
  • Constructor Details

    • ExponentialDecayFunction

      public ExponentialDecayFunction(double initValue, double valueAtNumCall, long numCall)
      Creates an instance. It will be such that
      • a = initValue
      • b = -numCall / ln(valueAtNumCall / initValue)
      Parameters:
      initValue - Initial value, i.e. value(0).
      valueAtNumCall - Value of the function at numCall.
      numCall - Argument for which the function returns valueAtNumCall.
      Throws:
      NotStrictlyPositiveException - if initValue <= 0.
      NotStrictlyPositiveException - if valueAtNumCall <= 0.
      NumberIsTooLargeException - if valueAtNumCall >= initValue.
      NotStrictlyPositiveException - if numCall <= 0.
  • Method Details

    • value

      public double value(long numCall)
      Computes a e-numCall / b.
      Parameters:
      numCall - Current step of the training task.
      Returns:
      the value of the function at numCall.