Package network.aika.neuron.activation
Class Activation
- java.lang.Object
-
- network.aika.neuron.activation.Activation
-
- All Implemented Interfaces:
Comparable<Activation>
public class Activation extends Object implements Comparable<Activation>
TheActivationclass is the most central class in Aika. On the one hand it stores the activation value for a given neuron in theStatesubstructure. On the other hand it specifies where this activation is located within the document and to which interpretation it belongs. TheActivation.Keytherefore consists of the logic node to which this activation belongs. If this logic node is an or-node, then this activation automatically also belongs to the neuron as well. Furthermore, the key contains the char range within the document and the relational id (rid). The relational id might be used to store the word pos for instance. Lastly, the key contain the interpretation node of this activation, specifying to which interpretation this activation belongs.The activations are linked to each other on two levels. The fields
inputsandoutputscontain the activation links within the logic layer. The fieldsinputLinksandoutputLinkscontain the links on the neural layer.- Author:
- Lukas Molzberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActivation.Builderstatic classActivation.LinkTheSynapseActivationmirror the synapse link in the network of activations.static classActivation.ModeclassActivation.Optionstatic classActivation.OscillatingActivationsExceptionstatic classActivation.RecursiveDepthExceededExceptionstatic classActivation.RoundsSince Aika is a recurrent neural network, it is necessary to compute several rounds of activation values.static classActivation.StateAStateobject contains the activation value of an activation object that belongs to a neuron.classActivation.StateChangeTheStateChangeclass is used to store the state change of an activation that occurs in each node of the binary search tree.
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Activation>ACTIVATION_ID_COMPstatic intBEGINbooleanblockedstatic booleanDEBUG_OUTPUTstatic intENDlongmarkedAncDesclongmarkedHasCandidatestatic ActivationMAX_ACTIVATIONstatic intMAX_PREDECESSOR_DEPTHstatic intMAX_SELF_REFERENCING_DEPTHstatic ActivationMIN_ACTIVATION
-
Method Summary
-
-
-
Field Detail
-
BEGIN
public static int BEGIN
-
END
public static int END
-
ACTIVATION_ID_COMP
public static final Comparator<Activation> ACTIVATION_ID_COMP
-
MAX_SELF_REFERENCING_DEPTH
public static int MAX_SELF_REFERENCING_DEPTH
-
MAX_PREDECESSOR_DEPTH
public static int MAX_PREDECESSOR_DEPTH
-
DEBUG_OUTPUT
public static boolean DEBUG_OUTPUT
-
MIN_ACTIVATION
public static final Activation MIN_ACTIVATION
-
MAX_ACTIVATION
public static final Activation MAX_ACTIVATION
-
markedHasCandidate
public long markedHasCandidate
-
markedAncDesc
public long markedAncDesc
-
blocked
public boolean blocked
-
-
Method Detail
-
setInputNodeActivation
public void setInputNodeActivation(OrNode.OrActivation inputNodeActivation)
-
getInputNodeActivation
public OrNode.OrActivation getInputNodeActivation()
-
getOutputNodeActivation
public InputNode.InputActivation getOutputNodeActivation()
-
setOutputNodeActivation
public void setOutputNodeActivation(InputNode.InputActivation outputNodeActivation)
-
lookupSlot
public Position lookupSlot(int slot)
-
length
public Integer length()
-
getId
public int getId()
-
getDocument
public Document getDocument()
-
getThreadId
public int getThreadId()
-
getNewVisitedId
public long getNewVisitedId()
-
getVisitedId
public long getVisitedId()
-
checkVisited
public boolean checkVisited(long v)
-
getOptions
public Collection<Activation.Option> getOptions()
-
getLabel
public String getLabel()
-
getType
public INeuron.Type getType()
-
getText
public String getText()
-
getINeuron
public INeuron getINeuron()
-
getNeuron
public Neuron getNeuron()
-
getSynapseById
public Synapse getSynapseById(int synapseId)
-
getUpperBound
public double getUpperBound()
-
setUpperBound
public void setUpperBound(double upperBound)
-
getLowerBound
public double getLowerBound()
-
setLowerBound
public void setLowerBound(double lowerBound)
-
getTargetValue
public Double getTargetValue()
-
getInputValue
public Double getInputValue()
-
getInputDecision
public SearchNode.Decision getInputDecision()
-
getDecision
public SearchNode.Decision getDecision()
-
getFinalDecision
public SearchNode.Decision getFinalDecision()
-
addLink
public void addLink(Linker.Direction dir, Activation.Link l)
-
getLinkBySynapseId
public Activation.Link getLinkBySynapseId(int synapseId)
-
getInputLinks
public Stream<Activation.Link> getInputLinks(boolean onlySelected)
-
getOutputLinks
public Stream<Activation.Link> getOutputLinks()
-
getInputLink
public Activation.Link getInputLink(Activation.Link l)
-
getInputLinksBySynapse
public Stream<Activation.Link> getInputLinksBySynapse(Synapse syn)
-
getOutputLinksBySynapse
public Stream<Activation.Link> getOutputLinksBySynapse(Synapse syn)
-
process
public double process(SearchNode sn, int round, long v) throws Activation.OscillatingActivationsException, Activation.RecursiveDepthExceededException
-
computeValueAndWeight
public Activation.State computeValueAndWeight(int round) throws Activation.RecursiveDepthExceededException
-
isActiveable
public boolean isActiveable()
-
processBounds
public void processBounds() throws Activation.RecursiveDepthExceededException
-
computeBounds
public void computeBounds() throws Activation.RecursiveDepthExceededException
-
getActivationFunction
public ActivationFunction getActivationFunction()
-
hasUndecidedPositiveFeedbackLinks
public boolean hasUndecidedPositiveFeedbackLinks()
-
isOscillating
public boolean isOscillating()
-
setInputState
public void setInputState(Activation.Builder input)
-
getFinalInputActivationLinks
public List<Activation.Link> getFinalInputActivationLinks()
-
getFinalOutputActivationLinks
public List<Activation.Link> getFinalOutputActivationLinks()
-
getConflicts
public Collection<Activation> getConflicts() throws Activation.RecursiveDepthExceededException
-
adjustSelectedNeuronInputs
public void adjustSelectedNeuronInputs(SearchNode.Decision d)
-
checkSelfReferencing
public boolean checkSelfReferencing(boolean onlySelected, int depth, long v)
-
setDecision
public void setDecision(SearchNode.Decision newDecision, long v)
-
isFinalActivation
public boolean isFinalActivation()
-
getFinalState
public Activation.State getFinalState()
-
getValue
public double getValue()
-
getSequence
public Integer getSequence()
-
markDirty
public void markDirty(long v)
-
markPredecessor
public void markPredecessor(long v, int depth) throws Activation.RecursiveDepthExceededException
-
match
public boolean match(Predicate<Activation.Link> filter)
-
toStringDetailed
public String toStringDetailed()
-
getExpectedState
public Activation.State getExpectedState()
-
compareTo
public int compareTo(Activation act)
- Specified by:
compareToin interfaceComparable<Activation>
-
slotsToString
public String slotsToString()
-
identityToString
public String identityToString()
-
linksToString
public String linksToString()
-
saveOldState
public void saveOldState(Map<Activation,Activation.StateChange> changes, long v)
-
saveNewState
public void saveNewState()
-
-