ca.nengo.math.impl
Class SigmoidFunction
java.lang.Object
ca.nengo.math.impl.AbstractFunction
ca.nengo.math.impl.SigmoidFunction
- All Implemented Interfaces:
- DifferentiableFunction, Function, java.io.Serializable, java.lang.Cloneable
public class SigmoidFunction
- extends AbstractFunction
- implements DifferentiableFunction
A one-dimensional sigmoid function with configurable high and low
values, slope, and inflection point.
TODO: unit tests
- Author:
- Bryan Tripp
- See Also:
- Serialized Form
|
Constructor Summary |
SigmoidFunction()
Default parameters (inflection=0; slope=1/4; low=0; high=1). |
SigmoidFunction(float inflection,
float slope,
float low,
float high)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SigmoidFunction
public SigmoidFunction()
- Default parameters (inflection=0; slope=1/4; low=0; high=1).
SigmoidFunction
public SigmoidFunction(float inflection,
float slope,
float low,
float high)
- Parameters:
inflection - Inflection pointslope - Slope at inflection point (usually 1/4)low - Result for inputs much lower than inflection pointhigh - Result for inputs much higher than inflection point
getInflection
public float getInflection()
- Returns:
- Inflection point
setInflection
public void setInflection(float inflection)
- Parameters:
inflection - Inflection point
getSlope
public float getSlope()
- Returns:
- Slope at inflection point
setSlope
public void setSlope(float slope)
- Parameters:
slope - Slope at inflection point
getLow
public float getLow()
- Returns:
- Result for inputs much lower than inflection point
setLow
public void setLow(float low)
- Parameters:
low - Result for inputs much lower than inflection point
getHigh
public float getHigh()
- Returns:
- Result for inputs much higher than inflection point
setHigh
public void setHigh(float high)
- Parameters:
high - Result for inputs much higher than inflection point
getDerivative
public Function getDerivative()
- Specified by:
getDerivative in interface DifferentiableFunction
- Returns:
- The derivative of this Function
- See Also:
DifferentiableFunction.getDerivative()
map
public float map(float[] from)
- Specified by:
map in interface Function- Specified by:
map in class AbstractFunction
- Parameters:
from - Must have same length as getDimension()
- Returns:
- result of function operation on arg
- See Also:
Function.map(float[])
clone
public Function clone()
throws java.lang.CloneNotSupportedException
- Specified by:
clone in interface Function- Overrides:
clone in class AbstractFunction
- Throws:
java.lang.CloneNotSupportedException- See Also:
Object.clone()