Nengo.ca

ca.nengo.math.impl
Class SigmoidFunction

java.lang.Object
  extended by ca.nengo.math.impl.AbstractFunction
      extended by 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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ca.nengo.math.impl.AbstractFunction
DIMENSION_PROPERTY
 
Constructor Summary
SigmoidFunction()
          Default parameters (inflection=0; slope=1/4; low=0; high=1).
SigmoidFunction(float inflection, float slope, float low, float high)
           
 
Method Summary
 Function clone()
           
 Function getDerivative()
           
 float getHigh()
           
 float getInflection()
           
 float getLow()
           
 float getSlope()
           
 float map(float[] from)
           
 void setHigh(float high)
           
 void setInflection(float inflection)
           
 void setLow(float low)
           
 void setSlope(float slope)
           
 
Methods inherited from class ca.nengo.math.impl.AbstractFunction
getCode, getDimension, getName, multiMap, setCode, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.nengo.math.Function
getDimension, multiMap
 

Constructor Detail

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 point
slope - Slope at inflection point (usually 1/4)
low - Result for inputs much lower than inflection point
high - Result for inputs much higher than inflection point
Method Detail

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
Returns:
Valid clone
Throws:
java.lang.CloneNotSupportedException - is super does not support clone

Nengo.ca