com.anji.nn
Class AnjiNet

java.lang.Object
  extended by com.anji.nn.AnjiNet

public class AnjiNet
extends java.lang.Object

Aggregates all pieces for a full neural network.

Author:
Philip Tucker

Field Summary
static java.lang.String XML_TAG
          base XML tag
 
Constructor Summary
protected AnjiNet()
          for testing only
  AnjiNet(java.util.Collection someNeurons, java.util.List someInNeurons, java.util.List someOutNeurons, java.util.Collection someRecurrentConns, java.lang.String aName)
           
 
Method Summary
 long cost()
           
 void fullyActivate()
          make sure all neurons have been activated for the current cycle; this is to catch neurons with no forward outputs
 int getInputDimension()
           
 Neuron getInputNeuron(int idx)
           
 java.util.List getInputNeurons(int fromIdx, int toIdx)
           
 java.lang.String getName()
           
 int getOutputDimension()
           
 Neuron getOutputNeuron(int idx)
           
 java.util.List getOutputNeurons(int fromIdx, int toIdx)
           
 java.util.Collection getRecurrentConns()
           
protected  void init(java.util.Collection someNeurons, java.util.List someInNeurons, java.util.List someOutNeurons, java.util.Collection someRecurrentConns, java.lang.String aName)
           
 boolean isRecurrent()
           
 void reset()
          clear all memory in network, including neurons and recurrent connections
 void step()
          indicates a time step has passed
 java.lang.String toString()
           
 java.lang.String toXml()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_TAG

public static final java.lang.String XML_TAG
base XML tag

See Also:
Constant Field Values
Constructor Detail

AnjiNet

public AnjiNet(java.util.Collection someNeurons,
               java.util.List someInNeurons,
               java.util.List someOutNeurons,
               java.util.Collection someRecurrentConns,
               java.lang.String aName)
Parameters:
someNeurons -
someInNeurons -
someOutNeurons -
someRecurrentConns -
aName -

AnjiNet

protected AnjiNet()
for testing only

Method Detail

cost

public long cost()
Returns:
number corresponding to cost of network activation in resources

init

protected void init(java.util.Collection someNeurons,
                    java.util.List someInNeurons,
                    java.util.List someOutNeurons,
                    java.util.Collection someRecurrentConns,
                    java.lang.String aName)
Parameters:
someNeurons - all neurons
someInNeurons - input neurons (also included in someNeurons)
someOutNeurons - output neurons (also included in someNeurons)
someRecurrentConns - recurrent connections
aName -

getInputNeuron

public Neuron getInputNeuron(int idx)
Parameters:
idx -
Returns:
input neuron at position idx

getInputDimension

public int getInputDimension()
Returns:
number input neurons

getOutputNeuron

public Neuron getOutputNeuron(int idx)
Parameters:
idx -
Returns:
output neuron at position idx

getOutputNeurons

public java.util.List getOutputNeurons(int fromIdx,
                                       int toIdx)
Parameters:
fromIdx -
toIdx -
Returns:
output neurons from position toIdx (inclusive) to fromIdx (exclusive)

getInputNeurons

public java.util.List getInputNeurons(int fromIdx,
                                      int toIdx)
Parameters:
fromIdx -
toIdx -
Returns:
input neurons from position toIdx (inclusive) to fromIdx (exclusive)

getOutputDimension

public int getOutputDimension()
Returns:
number output neurons

getRecurrentConns

public java.util.Collection getRecurrentConns()
Returns:
Collection contains recurrent Connection objects

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getName

public java.lang.String getName()
Returns:
the name.

step

public void step()
indicates a time step has passed


fullyActivate

public void fullyActivate()
make sure all neurons have been activated for the current cycle; this is to catch neurons with no forward outputs


reset

public void reset()
clear all memory in network, including neurons and recurrent connections


toXml

public java.lang.String toXml()
Returns:
String XML representation

isRecurrent

public boolean isRecurrent()
Returns:
true if network contains any recurrent connections, false otherwise