com.penguinwerks.jodene.activation
Class SigmoidActivationFunction

java.lang.Object
  extended bycom.penguinwerks.jodene.activation.SigmoidActivationFunction
All Implemented Interfaces:
ActivationFunction, java.io.Serializable

public class SigmoidActivationFunction
extends java.lang.Object
implements ActivationFunction, java.io.Serializable

The sigmoid activation function. This is probably the most popular non-linear squashing function used in neural networks. The activation value is computed as per the sigmoid function 1/(1 + exp(-x)). The output is then scaled between the min and max values.

Author:
Paul Hoehne
See Also:
Serialized Form

Constructor Summary
SigmoidActivationFunction()
          Default constructor.
 
Method Summary
 double activation(double val)
          Calculates the activation value as per the sigmoid function.
 double derivative(double val)
          Calculate the derivative of the activation value.
 double getMax()
          The maximum value for activation.
 double getMin()
          The minimum value for activation.
static void main(java.lang.String[] args)
           
 void setMax(double val)
          The maximum value for output activation.
 void setMin(double val)
          The mimimum output value for activation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigmoidActivationFunction

public SigmoidActivationFunction()
Default constructor.

Method Detail

setMin

public void setMin(double val)
The mimimum output value for activation.

Parameters:
val - The minimum value.

setMax

public void setMax(double val)
The maximum value for output activation.

Parameters:
val - The maximum value.

getMin

public double getMin()
The minimum value for activation.

Returns:
The minimum value for activation.

getMax

public double getMax()
The maximum value for activation.

Returns:
The max value for activation.

activation

public double activation(double val)
Calculates the activation value as per the sigmoid function.

Specified by:
activation in interface ActivationFunction
Parameters:
val - The raw value.
Returns:
The activation value.

derivative

public double derivative(double val)
Calculate the derivative of the activation value.

Specified by:
derivative in interface ActivationFunction
Parameters:
val - The raw value.
Returns:
The derivative of the raw value.

main

public static void main(java.lang.String[] args)