org.encog.neural.freeform.basic
Class BasicFreeformNeuron
- java.lang.Object
-
- org.encog.neural.freeform.basic.BasicFreeformNeuron
-
- All Implemented Interfaces:
- java.io.Serializable, FreeformNeuron, TempTrainingData
- Direct Known Subclasses:
- FreeformContextNeuron
public class BasicFreeformNeuron extends java.lang.Object implements FreeformNeuron, java.io.Serializable
This class provides a basic implementation of a freeform neuron.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description BasicFreeformNeuron(InputSummation theInputSummation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddInput(FreeformConnection connection)Add an input connection to this neuron.voidaddOutput(FreeformConnection connection)Add an output connection to this neuron.voidaddTempTraining(int i, double value)Add to the specified temp value.voidallocateTempTraining(int l)Allocate the specified length of temp training.voidclearTempTraining()Clear the temp training.doublegetActivation()InputSummationgetInputSummation()java.util.List<FreeformConnection>getOutputs()doublegetSum()doublegetTempTraining(int index)Get the specified temp training.booleanisBias()voidperformCalculation()Perform the internal calculation for this neuron.voidsetActivation(double theActivation)Set the activation, or final output for this neuron.voidsetBias(boolean bias)Determine if this neuron is a bias neuron.voidsetInputSummation(InputSummation theInputSummation)Set the input summation method.voidsetTempTraining(int index, double value)Set a temp training value.java.lang.StringtoString()voidupdateContext()Update the context value for this neuron.
-
-
-
Constructor Detail
-
BasicFreeformNeuron
public BasicFreeformNeuron(InputSummation theInputSummation)
-
-
Method Detail
-
addInput
public void addInput(FreeformConnection connection)
Add an input connection to this neuron.- Specified by:
addInputin interfaceFreeformNeuron- Parameters:
connection- The input connection.
-
addOutput
public void addOutput(FreeformConnection connection)
Add an output connection to this neuron.- Specified by:
addOutputin interfaceFreeformNeuron- Parameters:
connection- The output connection.
-
addTempTraining
public void addTempTraining(int i, double value)Add to the specified temp value.- Specified by:
addTempTrainingin interfaceTempTrainingData- Parameters:
i- The index.value- The value to add.
-
allocateTempTraining
public void allocateTempTraining(int l)
Allocate the specified length of temp training.- Specified by:
allocateTempTrainingin interfaceTempTrainingData- Parameters:
l- The length.
-
clearTempTraining
public void clearTempTraining()
Clear the temp training.- Specified by:
clearTempTrainingin interfaceTempTrainingData
-
getActivation
public double getActivation()
- Specified by:
getActivationin interfaceFreeformNeuron- Returns:
- The activation for this neuron. This is the final output after the activation function has been applied.
-
getInputSummation
public InputSummation getInputSummation()
- Specified by:
getInputSummationin interfaceFreeformNeuron- Returns:
- The input summation method.
-
getOutputs
public java.util.List<FreeformConnection> getOutputs()
- Specified by:
getOutputsin interfaceFreeformNeuron- Returns:
- The outputs from this neuron.
-
getSum
public double getSum()
- Specified by:
getSumin interfaceFreeformNeuron- Returns:
- The output sum for this neuron. This is the output prior to the activation function being applied.
-
getTempTraining
public double getTempTraining(int index)
Get the specified temp training.- Specified by:
getTempTrainingin interfaceTempTrainingData- Parameters:
index- The indfex.- Returns:
- The temp training value.
-
isBias
public boolean isBias()
- Specified by:
isBiasin interfaceFreeformNeuron- Returns:
- True, if this is a bias neuron.
-
performCalculation
public void performCalculation()
Perform the internal calculation for this neuron.- Specified by:
performCalculationin interfaceFreeformNeuron
-
setActivation
public void setActivation(double theActivation)
Set the activation, or final output for this neuron.- Specified by:
setActivationin interfaceFreeformNeuron- Parameters:
theActivation- THe activation.
-
setBias
public void setBias(boolean bias)
Determine if this neuron is a bias neuron.- Specified by:
setBiasin interfaceFreeformNeuron- Parameters:
bias- True, if this neuron is considered a bias neuron.
-
setInputSummation
public void setInputSummation(InputSummation theInputSummation)
Set the input summation method.- Specified by:
setInputSummationin interfaceFreeformNeuron- Parameters:
theInputSummation- The input summation method.
-
setTempTraining
public void setTempTraining(int index, double value)Set a temp training value.- Specified by:
setTempTrainingin interfaceTempTrainingData- Parameters:
index- The index.value- The value.
-
updateContext
public void updateContext()
Update the context value for this neuron.- Specified by:
updateContextin interfaceFreeformNeuron
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG