marf.Classification.NeuralNetwork
Class Layer

java.lang.Object
  extended by java.lang.Thread
      extended by marf.util.BaseThread
          extended by marf.Classification.NeuralNetwork.Layer
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable

public class Layer
extends BaseThread
implements java.io.Serializable

Represents a Neural Network Layer. Being itself a thread, encapsulates a group of Neuron thread comprising a neuron layer of the network. The actual threading is almost unimplemented yet, but the class itself is properly synchronized.

$Id: Layer.java,v 1.10 2007/12/31 00:17:04 mokhov Exp $

Since:
0.3.0.2
Version:
$Revision: 1.10 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
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
Layer()
          Default constructor.
 
Method Summary
 boolean add(Neuron poNeuron)
          Allows adding a neuron to the layer.
 void commit()
          Applies changes made to neurons on this layer.
 void eval()
          Evaluates the layer by evaluating each neuron in it.
 Neuron get(int piIndex)
          Allows getting a neuron object given index.
 java.util.ArrayList getLayerData()
          Allows querying raw layer data collection.
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 Neuron getNeuron(java.lang.String pstrName)
          Returns the Neuron called by its name string.
 void run()
          For threading does evaluation.
 int size()
          Allows querying for layer size in terms of number of neurons.
 void train(double pdTrainConst)
          Performs training on each neuron in this layer given the training constant between 0.0 and 1.0.
 
Methods inherited from class marf.util.BaseThread
getNextTID, getTarget, getTID
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Constructor Detail

Layer

public Layer()
Default constructor.

Method Detail

eval

public void eval()
Evaluates the layer by evaluating each neuron in it.

Since:
0.3.0.5

train

public void train(double pdTrainConst)
Performs training on each neuron in this layer given the training constant between 0.0 and 1.0.

Parameters:
pdTrainConst - training constant to use for neurons
Since:
0.3.0.5

commit

public final void commit()
Applies changes made to neurons on this layer.

Since:
0.3.0.5

run

public void run()
For threading does evaluation. TODO: complete.

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

get

public Neuron get(int piIndex)
Allows getting a neuron object given index.

Parameters:
piIndex - the index to fetch the neuron from.
Returns:
the neuron object corresponding to the index if found
Since:
0.3.0.5

add

public boolean add(Neuron poNeuron)
Allows adding a neuron to the layer.

Parameters:
poNeuron - the neuron to add
Returns:
true if the neuron was added
Since:
0.3.0.5

size

public int size()
Allows querying for layer size in terms of number of neurons.

Returns:
the layer size
Since:
0.3.0.5

getNeuron

public Neuron getNeuron(java.lang.String pstrName)
Returns the Neuron called by its name string.

Parameters:
pstrName - the neuron name to search for
Returns:
the name Neuron object if found
Since:
0.3.0.5

getLayerData

public java.util.ArrayList getLayerData()
Allows querying raw layer data collection.

Returns:
the collection of neurons
Since:
0.3.0.5

getMARFSourceCodeRevision

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

Returns:
revision string


SourceForge Logo