Package network.aika.neuron.activation
Class Activation
- java.lang.Object
-
- network.aika.neuron.activation.Activation
-
- All Implemented Interfaces:
Comparable<Activation>
public final 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.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 intBEGINbooleanblockedCandidatecandidateActivation.StateChangecurrentStateChangelongcurrentStateVstatic booleanDEBUG_OUTPUTSearchNode.Decisiondecisionstatic intENDWritableextensionSearchNode.DecisionfinalDecisionActivation.RoundsfinalRoundsSearchNode.DecisioninputDecisionDoubleinputValuedoublelowerBoundlongmarkedAncDesclongmarkedDirtylongmarkedHasCandidatelongmarkedPredecessorstatic ActivationMAX_ACTIVATIONstatic intMAX_PREDECESSOR_DEPTHstatic intMAX_SELF_REFERENCING_DEPTHstatic ActivationMIN_ACTIVATIONList<Activation.Option>optionsActivation.RoundsroundsIntegersequenceMap<Integer,Position>slotsDoubletargetValuebooleanubQueueddoubleupperBound
-
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 Activation MIN_ACTIVATION
-
MAX_ACTIVATION
public static Activation MAX_ACTIVATION
-
sequence
public Integer sequence
-
upperBound
public double upperBound
-
lowerBound
public double lowerBound
-
options
public List<Activation.Option> options
-
rounds
public Activation.Rounds rounds
-
finalRounds
public Activation.Rounds finalRounds
-
ubQueued
public boolean ubQueued
-
markedHasCandidate
public long markedHasCandidate
-
currentStateV
public long currentStateV
-
currentStateChange
public Activation.StateChange currentStateChange
-
markedDirty
public long markedDirty
-
markedPredecessor
public long markedPredecessor
-
targetValue
public Double targetValue
-
inputValue
public Double inputValue
-
extension
public Writable extension
-
inputDecision
public SearchNode.Decision inputDecision
-
decision
public SearchNode.Decision decision
-
finalDecision
public SearchNode.Decision finalDecision
-
candidate
public Candidate candidate
-
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)
-
getSlot
public Position getSlot(int slot)
-
length
public Integer length()
-
setTargetValue
public void setTargetValue(Double targetValue)
-
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)
-
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)
-
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)
-
computeValueAndWeight
public Activation.State computeValueAndWeight(int round)
-
isActiveable
public boolean isActiveable()
-
processBounds
public void processBounds()
-
computeBounds
public void computeBounds()
-
getActivationFunction
public ActivationFunction getActivationFunction()
-
hasUndecidedPositiveFeedbackLinks
public boolean hasUndecidedPositiveFeedbackLinks()
-
getFinalInputActivationLinks
public List<Activation.Link> getFinalInputActivationLinks()
-
getFinalOutputActivationLinks
public List<Activation.Link> getFinalOutputActivationLinks()
-
getConflicts
public Collection<Activation> getConflicts()
-
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()
-
getSequence
public Integer getSequence()
-
markDirty
public void markDirty(long v)
-
markPredecessor
public void markPredecessor(long v, int depth)
-
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()
-
-