net.sourceforge.cilib.functions.activation
Class Sigmoid

java.lang.Object
  extended by net.sourceforge.cilib.functions.Function
      extended by net.sourceforge.cilib.functions.activation.ActivationFunction
          extended by net.sourceforge.cilib.functions.activation.Sigmoid
All Implemented Interfaces:
Serializable, Differentiable, Cloneable

public class Sigmoid
extends ActivationFunction

The generalised sigmoid function. The function is the general case of the sigmoid function with the ability to specify the steepness of the function as well as an offset that should be taken into consideration.

See Also:
Serialized Form

Constructor Summary
Sigmoid()
          Create a new instance of Sigmoid.
 
Method Summary
 Double evaluate(Number number)
          Determine the value of the ActivationFunction at the provided point.
 Double evaluate(Type x)
          Each function must provide an implementation which returns the function value at the given position.
 Sigmoid getClone()
          Create a cloned copy of the current object and return it.
 Double getGradient(Number number)
          Determine the gradient of the ActivationFunction at the given point.
 Vector getGradient(Vector x)
          Obtain the gradient Vector for the provided input Vector.
 Object getMaximum()
          Accessor for the function maximum.
 Object getMinimum()
          Accessor for the function minimum.
 ControlParameter getOffset()
          Get the offset associated with the function.
 ControlParameter getSteepness()
          Get the steepness associated with the Sigmoid.
 void setOffset(ControlParameter offset)
          Set the ControlParameter to represent the offset of the function.
 void setSteepness(ControlParameter steepness)
          Set the ControlParameter to represent the steepness of the function.
 
Methods inherited from class net.sourceforge.cilib.functions.Function
getBehavioralDomainRegistry, getDimension, getDomain, getDomainRegistry, setBehavioralDomain, setBehaviouralDomainRegistry, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sigmoid

public Sigmoid()
Create a new instance of Sigmoid. The default instance has the steepness control parameter set to a value of 1.0, with the offset defined as 0.0.

Method Detail

getClone

public Sigmoid getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

evaluate

public Double evaluate(Type x)
Each function must provide an implementation which returns the function value at the given position. The length of the position array should be the same as the function dimension.

Specified by:
evaluate in class ActivationFunction
Parameters:
x - the position
Returns:
The result of the evaluation.

evaluate

public Double evaluate(Number number)
Determine the value of the ActivationFunction at the provided point. The provided point is simply a Number that is provided as input.

Specified by:
evaluate in class ActivationFunction
Parameters:
number - The input value.
Returns:
The evaluation of the ActivationFunction, given number as input.

getMaximum

public Object getMaximum()
Accessor for the function maximum. This is the maximum value of the function in the given domain.

Specified by:
getMaximum in class Function
Returns:
The maximum of the function.

getMinimum

public Object getMinimum()
Accessor for the function minimum. This is the minimum value of the function in the given domain.

Specified by:
getMinimum in class Function
Returns:
The minimum function value.

getGradient

public Vector getGradient(Vector x)
Obtain the gradient Vector for the provided input Vector. The gradient is, naturally, the derivative of the Function which implements this interface.

Parameters:
x - The provided input Vector to calculate the derivative at.
Returns:
A Vector containing the gradient of the provided input.

getGradient

public Double getGradient(Number number)
Determine the gradient of the ActivationFunction at the given point.

Specified by:
getGradient in class ActivationFunction
Parameters:
number - The point at which the gradient is to be determined.
Returns:
The value of the gradient and the provided input.

getSteepness

public ControlParameter getSteepness()
Get the steepness associated with the Sigmoid.

Returns:
The ControlParameter representing the steepness.

setSteepness

public void setSteepness(ControlParameter steepness)
Set the ControlParameter to represent the steepness of the function.

Parameters:
steepness - The value to set.

getOffset

public ControlParameter getOffset()
Get the offset associated with the function.

Returns:
The ControlParameter representing the offset.

setOffset

public void setOffset(ControlParameter offset)
Set the ControlParameter to represent the offset of the function.

Parameters:
offset - The value to set.


Copyright © 2009 CIRG. All Rights Reserved.