Class NeighbourhoodSizeFunctionFactory
- java.lang.Object
-
- org.apache.commons.math4.neuralnet.sofm.NeighbourhoodSizeFunctionFactory
-
public final class NeighbourhoodSizeFunctionFactory extends Object
Factory for creating instances ofNeighbourhoodSizeFunction
.- Since:
- 3.3
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NeighbourhoodSizeFunction
exponentialDecay(double initValue, double valueAtNumCall, long numCall)
Creates an exponential decayfunction
.static NeighbourhoodSizeFunction
quasiSigmoidDecay(double initValue, double slope, long numCall)
Creates an sigmoid-likeNeighbourhoodSizeFunction function
.
-
-
-
Method Detail
-
exponentialDecay
public static NeighbourhoodSizeFunction exponentialDecay(double initValue, double valueAtNumCall, long numCall)
Creates an exponential decayfunction
. It will computea e-x / b
, wherex
is the (integer) independent variable anda = initValue
b = -numCall / ln(valueAtNumCall / initValue)
- Parameters:
initValue
- Initial value, i.e.value(0)
.valueAtNumCall
- Value of the function atnumCall
.numCall
- Argument for which the function returnsvalueAtNumCall
.- Returns:
- the neighbourhood size function.
- Throws:
IllegalArgumentException
- ifinitValue <= 0
,valueAtNumCall <= 0
,valueAtNumCall >= initValue
ornumCall <= 0
.
-
quasiSigmoidDecay
public static NeighbourhoodSizeFunction quasiSigmoidDecay(double initValue, double slope, long numCall)
Creates an sigmoid-likeNeighbourhoodSizeFunction function
. The functionf
will have the following properties:f(0) = initValue
numCall
is the inflexion pointslope = f'(numCall)
- Parameters:
initValue
- Initial value, i.e.value(0)
.slope
- Value of the function derivative atnumCall
.numCall
- Inflexion point.- Returns:
- the neighbourhood size function.
- Throws:
IllegalArgumentException
- ifinitValue <= 0
,slope >= 0
ornumCall <= 0
.
-
-