|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.engine.network.activation.ActivationStep
public class ActivationStep
The step activation function is a very simple activation function. It is the activation function that was used by the original perceptron. Using the default parameters it will return 1 if the input is 0 or greater. Otherwise it will return 1. The center, low and high properties allow you to define how this activation function works. If the input is equal to center or higher the high property value will be returned, otherwise the low property will be returned. This activation function does not have a derivative, and can not be used with propagation training, or any other training that requires a derivative.
Field Summary | |
---|---|
static int |
PARAM_STEP_CENTER
The step center parameter. |
static int |
PARAM_STEP_HIGH
The step high parameter. |
static int |
PARAM_STEP_LOW
The step low parameter. |
Constructor Summary | |
---|---|
ActivationStep()
Create a basic step activation with low=0, center=0, high=1. |
|
ActivationStep(double low,
double center,
double high)
Construct a step activation function. |
Method Summary | |
---|---|
void |
activationFunction(double[] x,
int start,
int size)
Implements the activation function. |
ActivationFunction |
clone()
|
double |
derivativeFunction(double b,
double a)
Calculate the derivative. |
double |
getCenter()
|
String |
getFactoryCode()
|
double |
getHigh()
|
double |
getLow()
|
String[] |
getParamNames()
|
double[] |
getParams()
|
boolean |
hasDerivative()
|
void |
setCenter(double d)
Set the center of this function. |
void |
setHigh(double d)
Set the high of this function. |
void |
setLow(double d)
Set the low of this function. |
void |
setParam(int index,
double value)
Set one of the params for this activation function. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PARAM_STEP_CENTER
public static final int PARAM_STEP_LOW
public static final int PARAM_STEP_HIGH
Constructor Detail |
---|
public ActivationStep()
public ActivationStep(double low, double center, double high)
low
- The low of the function.center
- The center of the function.high
- The high of the function.Method Detail |
---|
public final void activationFunction(double[] x, int start, int size)
activationFunction
in interface ActivationFunction
x
- The input array to the activation function.start
- The starting index.size
- The number of values to calculate.public final ActivationFunction clone()
clone
in interface ActivationFunction
clone
in class Object
public final double derivativeFunction(double b, double a)
derivativeFunction
in interface ActivationFunction
b
- The number to calculate the derivative of, the number "before" the
activation function was applied.a
- The number "after" an activation function has been applied.
public final double getCenter()
public final double getHigh()
public final double getLow()
public final String[] getParamNames()
getParamNames
in interface ActivationFunction
public final double[] getParams()
getParams
in interface ActivationFunction
public final boolean hasDerivative()
hasDerivative
in interface ActivationFunction
public final void setCenter(double d)
d
- The center of this function.public final void setHigh(double d)
d
- The high of this function.public final void setLow(double d)
d
- The low of this function.public final void setParam(int index, double value)
setParam
in interface ActivationFunction
index
- The index of the param to set.value
- The value to set.public String getFactoryCode()
getFactoryCode
in interface ActivationFunction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |