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
, wherex
is 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 double
applyAsDouble(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 = initValue
b = -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 >= initValue
ornumCall <= 0
.
-
-
Method Detail
-
applyAsDouble
public double applyAsDouble(long numCall)
Computesa e-numCall / b
.- Specified by:
applyAsDouble
in interfaceLongToDoubleFunction
- Parameters:
numCall
- Current step of the training task.- Returns:
- the value of the function at
numCall
.
-
-