com.anji.nn
Class CacheNeuronConnection

java.lang.Object
  extended by com.anji.nn.NeuronConnection
      extended by com.anji.nn.CacheNeuronConnection
All Implemented Interfaces:
Connection

public class CacheNeuronConnection
extends NeuronConnection

A connection between neurons that caches its value from previous timestep. This is used to avoid deadlock when activating neurons and connections in a loop.

Author:
Philip Tucker

Field Summary
 
Fields inherited from interface com.anji.nn.Connection
XML_TAG
 
Constructor Summary
CacheNeuronConnection(Neuron anIncoming)
           
CacheNeuronConnection(Neuron anIncoming, double aWeight)
           
 
Method Summary
 long cost()
           
 boolean isRecurrent()
           
 double read()
           
 void reset()
          clear cached value
 void step()
          update value
 java.lang.String toXml()
           
 
Methods inherited from class com.anji.nn.NeuronConnection
appendToXml, getId, getIncomingNode, getWeight, setId, setWeight, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheNeuronConnection

public CacheNeuronConnection(Neuron anIncoming)
See Also:
NeuronConnection.NeuronConnection(Neuron)

CacheNeuronConnection

public CacheNeuronConnection(Neuron anIncoming,
                             double aWeight)
See Also:
NeuronConnection.NeuronConnection(Neuron, double)
Method Detail

read

public double read()
Specified by:
read in interface Connection
Overrides:
read in class NeuronConnection
Returns:
double cached value

step

public void step()
update value


toXml

public java.lang.String toXml()
Specified by:
toXml in interface Connection
Overrides:
toXml in class NeuronConnection
Returns:
String XML representation of object

reset

public void reset()
clear cached value


isRecurrent

public boolean isRecurrent()
Overrides:
isRecurrent in class NeuronConnection
Returns:
true

cost

public long cost()
Specified by:
cost in interface Connection
Overrides:
cost in class NeuronConnection
Returns:
number corresponding to cost of activation in resources
See Also:
Connection.cost()