marf.Classification.NeuralNetwork
Class Neuron

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--marf.util.BaseThread
              |
              +--marf.Classification.NeuralNetwork.Neuron
All Implemented Interfaces:
java.lang.Runnable

public class Neuron
extends BaseThread

Class Neuron -- a basic element of a neural network.

$Id: Neuron.java,v 1.13 2005/06/16 19:58:42 mokhov Exp $

Since:
0.0.1
Version:
$Revision: 1.13 $
Author:
Ian Clement, Serguei Mokhov

Field Summary
 double delta
          Used in error calculation.
static int HIDDEN
          Indicates middle (hidden) neuron.
static int INPUT
          Indicates input neuron.
 java.lang.String name
          Neuron's name.
static int OUTPUT
          Indicates output neuron.
 double result
          Current Neuron's result.
 double threshold
          Activation threshhold.
 int type
          Current neuron type.
static int UNDEF
          Indicates undefined neuron type.
 
Fields inherited from class marf.util.BaseThread
iTID, oTarget, siNextTID
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Neuron(java.lang.String n, int t)
          Neuron's Constructor.
 
Method Summary
 boolean addInput(marf.Classification.NeuralNetwork.Neuron in, double weight)
          Adds an input neuron and its associated weight.
 boolean addOutput(marf.Classification.NeuralNetwork.Neuron out)
          Adds an output neuron.
 void commit()
          Applies weight changes.
 void eval()
          Evaluates current neuron's value.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 void printXML(java.io.BufferedWriter bw, int tab)
          Dumps XML of the current Neuron.
 void run()
          The body of a Neuron thread.
 void train(double expected, double alpha, double beta)
          Neuron training.
 
Methods inherited from class marf.util.BaseThread
getNextTID, getTarget, getTID
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNDEF

public static final int UNDEF
Indicates undefined neuron type.

See Also:
Constant Field Values

INPUT

public static final int INPUT
Indicates input neuron.

See Also:
Constant Field Values

HIDDEN

public static final int HIDDEN
Indicates middle (hidden) neuron.

See Also:
Constant Field Values

OUTPUT

public static final int OUTPUT
Indicates output neuron.

See Also:
Constant Field Values

name

public java.lang.String name
Neuron's name.


type

public int type
Current neuron type.


delta

public double delta
Used in error calculation.


threshold

public double threshold
Activation threshhold.


result

public double result
Current Neuron's result.

Constructor Detail

Neuron

public Neuron(java.lang.String n,
              int t)
Neuron's Constructor.

Parameters:
n - Neuron's name
t - Neuron's type
Method Detail

addInput

public final boolean addInput(marf.Classification.NeuralNetwork.Neuron in,
                              double weight)
Adds an input neuron and its associated weight.

Parameters:
in - Neuron to be added
weight - associated weight
Returns:
true if add was successful

addOutput

public final boolean addOutput(marf.Classification.NeuralNetwork.Neuron out)
Adds an output neuron.

Parameters:
out - the Neuron to add
Returns:
true if the neuron was added

eval

public final void eval()
Evaluates current neuron's value.


train

public final void train(double expected,
                        double alpha,
                        double beta)
Neuron training.

Parameters:
expected - expected value
alpha - used in error calculation
beta - used in error calculation

commit

public final void commit()
Applies weight changes.


printXML

public final void printXML(java.io.BufferedWriter bw,
                           int tab)
                    throws java.io.IOException
Dumps XML of the current Neuron.

Parameters:
bw - Writer object to write output
tab - tabulation needed
Throws:
java.io.IOException

run

public void run()
The body of a Neuron thread. TODO: implement.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread
Since:
0.3.0

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string
Since:
0.3.0