The Encog Project

org.encog.neural.activation
Class ActivationCompetitive

java.lang.Object
  extended by org.encog.neural.activation.BasicActivationFunction
      extended by org.encog.neural.activation.ActivationCompetitive
All Implemented Interfaces:
java.io.Serializable, ActivationFunction, EncogPersistedObject

public class ActivationCompetitive
extends BasicActivationFunction

An activation function that only allows a specified number, usually one, of the out-bound connection to win. These connections will share in the sum of the output, whereas the other neurons will receive zero. This activation function can be useful for "winner take all" layers.

See Also:
Serialized Form

Constructor Summary
ActivationCompetitive()
          Create a competitive activation function with one winner allowed.
ActivationCompetitive(int winners)
          Create a competitive activation function with the specified maximum number of winners.
 
Method Summary
 void activationFunction(double[] d)
          Perform the activation function.
 java.lang.Object clone()
           
 Persistor createPersistor()
          Create a Persistor for this activation function.
 void derivativeFunction(double[] d)
          Implements the activation function.
 int getMaxWinners()
           
 boolean hasDerivative()
           
 
Methods inherited from class org.encog.neural.activation.BasicActivationFunction
getDescription, getName, setDescription, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivationCompetitive

public ActivationCompetitive()
Create a competitive activation function with one winner allowed.


ActivationCompetitive

public ActivationCompetitive(int winners)
Create a competitive activation function with the specified maximum number of winners.

Parameters:
winners - The maximum number of winners that this function supports.
Method Detail

activationFunction

public void activationFunction(double[] d)
Perform the activation function.

Parameters:
d - The data to be given to the activation function.

clone

public java.lang.Object clone()
Specified by:
clone in class BasicActivationFunction
Returns:
A cloned copy of this object.

createPersistor

public Persistor createPersistor()
Description copied from class: BasicActivationFunction
Create a Persistor for this activation function.

Specified by:
createPersistor in interface EncogPersistedObject
Specified by:
createPersistor in class BasicActivationFunction
Returns:
A persistor for this object.

derivativeFunction

public void derivativeFunction(double[] d)
Implements the activation function. The array is modified according to the activation function being used. See the class description for more specific information on this type of activation function.

Parameters:
d - The input array to the activation function.

getMaxWinners

public int getMaxWinners()
Returns:
The maximum number of winners this function supports.

hasDerivative

public boolean hasDerivative()
Returns:
False, indication that no derivative is available for this function.

The Encog Project