Class ExponentialDecayFunction
- java.lang.Object
-
- org.apache.commons.math4.neuralnet.sofm.util.ExponentialDecayFunction
-
- All Implemented Interfaces:
LongToDoubleFunction
public class ExponentialDecayFunction extends Object implements LongToDoubleFunction
Exponential decay function:a e-x / b, wherexis the (integer) independent variable.
Class is immutable.- Since:
- 3.3
-
-
Constructor Summary
Constructors Constructor Description ExponentialDecayFunction(double initValue, double valueAtNumCall, long numCall)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleapplyAsDouble(long numCall)Computesa e-numCall / b.
-
-
-
Constructor Detail
-
ExponentialDecayFunction
public ExponentialDecayFunction(double initValue, double valueAtNumCall, long numCall)
Creates an instance. It will be such thata = initValueb = -numCall / ln(valueAtNumCall / initValue)
- Parameters:
initValue- Initial value, i.e.applyAsDouble(0).valueAtNumCall- Value of the function atnumCall.numCall- Argument for which the function returnsvalueAtNumCall.- Throws:
IllegalArgumentException- ifinitValue <= 0,valueAtNumCall <= 0,valueAtNumCall >= initValueornumCall <= 0.
-
-
Method Detail
-
applyAsDouble
public double applyAsDouble(long numCall)
Computesa e-numCall / b.- Specified by:
applyAsDoublein interfaceLongToDoubleFunction- Parameters:
numCall- Current step of the training task.- Returns:
- the value of the function at
numCall.
-
-