|
||||||||||
| 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 d)
Calculate the derivative of the activation. |
double |
getCenter()
|
double |
getHigh()
|
double |
getLow()
|
String |
getOpenCLExpression(boolean derivative)
Returns the OpenCL expression for this activation function. |
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(double low,
double center,
double high)
low - The low of the function.center - The center of the function.high - The high of the function.public ActivationStep()
| Method Detail |
|---|
public double getCenter()
public double getLow()
public double getHigh()
public ActivationFunction clone()
clone in interface ActivationFunctionclone in class Objectpublic boolean hasDerivative()
hasDerivative in interface ActivationFunctionpublic void setCenter(double d)
d - The center of this function.public void setHigh(double d)
d - The high of this function.public void setLow(double d)
d - The low of this function.
public void activationFunction(double[] x,
int start,
int size)
activationFunction in interface ActivationFunctionx - The input array to the activation function.start - The starting index.size - The number of values to calculate.public double derivativeFunction(double d)
derivativeFunction in interface ActivationFunctiond - The input array to the activation function.
public String[] getParamNames()
getParamNames in interface ActivationFunctionpublic double[] getParams()
getParams in interface ActivationFunction
public void setParam(int index,
double value)
setParam in interface ActivationFunctionindex - The index of the param to set.value - The value to set.public String getOpenCLExpression(boolean derivative)
getOpenCLExpression in interface ActivationFunctionderivative - True if we want the derivative, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||