public abstract class Node extends Object implements Comparable<Node>, Writable
Node class is the abstract class for all the boolean logic nodes underneath the neural network layer.
These nodes form a boolean representation for all the neurons of the neural network. Whenever changes occur to the
synapse weights in the neural layer, then the structure of the boolean representation needs to be adjusted. Several
neurons, however, might share common substructures in this boolean representation. The InputNode and
the AndNode classes together form a pattern lattice, containing all possible substructures of any
given conjunction. For example if we have the conjunction ABCD where A, B, C, D are the inputs then the
pattern lattice will contain the nodes ABCD, ABC, ABD, ACD, BCD, AB, AC, AD, BC, BD, CD, A, B, C, D. The class
OrNode is a disjunction of either input-nodes or and-nodes. The or-node is connected with one of
the neurons.
Each logic node has a set of activations. The activations are stored in the thread local data structure
ThreadState.| Modifier and Type | Class and Description |
|---|---|
static class |
Node.ReverseAndRefinement |
static class |
Node.RidVisited |
static class |
Node.RSKey |
static class |
Node.Similarity |
static class |
Node.ThreadState |
| Modifier and Type | Field and Description |
|---|---|
TreeMap<AndNode.Refinement,AndNode> |
andChildren |
static Comparator<Activation.Key> |
BEGIN_COMP |
static AtomicInteger |
currentNodeId |
static Comparator<Activation.Key> |
END_COMP |
boolean |
endRequired |
int |
frequency |
boolean |
frequencyHasChanged |
int |
id |
int |
instanceSum |
boolean |
isBlocked |
boolean |
isQueued |
boolean |
isRemoved |
int |
isRemovedId |
static int |
isRemovedIdCounter |
int |
level |
static boolean |
LINK_NEURON_RELATIONS_OPTIMIZATION |
ReadWriteLock |
lock |
static org.aika.lattice.Node.DummyNode |
MAX_NODE |
static int |
MAX_RID |
static org.aika.lattice.Node.DummyNode |
MIN_NODE |
static int |
minFrequency |
Neuron |
neuron |
int |
nOffset |
double |
nullHypFreq |
int |
numberOfNeuronRefs |
double |
oldNullHypFreq |
TreeSet<OrNode.OrEntry> |
orChildren |
boolean |
passive |
long |
queueId |
TreeMap<Node.ReverseAndRefinement,AndNode.Refinement> |
reverseAndChildren |
static Comparator<Activation.Key> |
RID_COMP |
boolean |
ridRequired |
int |
sizeSum |
Node.ThreadState[] |
threads |
static long |
visitedCounter |
| Modifier | Constructor and Description |
|---|---|
protected |
Node() |
|
Node(Document doc,
int level) |
public static int minFrequency
public static int MAX_RID
public static boolean LINK_NEURON_RELATIONS_OPTIMIZATION
public static final org.aika.lattice.Node.DummyNode MIN_NODE
public static final org.aika.lattice.Node.DummyNode MAX_NODE
public static AtomicInteger currentNodeId
public int id
public TreeMap<Node.ReverseAndRefinement,AndNode.Refinement> reverseAndChildren
public TreeMap<AndNode.Refinement,AndNode> andChildren
public TreeSet<OrNode.OrEntry> orChildren
public int level
public boolean passive
public volatile int frequency
public volatile double nullHypFreq
public volatile double oldNullHypFreq
public boolean isBlocked
public boolean endRequired
public boolean ridRequired
public int numberOfNeuronRefs
public volatile boolean isRemoved
public volatile int isRemovedId
public static int isRemovedIdCounter
public volatile boolean frequencyHasChanged
public volatile int nOffset
public volatile int sizeSum
public volatile int instanceSum
public ReadWriteLock lock
public boolean isQueued
public long queueId
public Neuron neuron
public static long visitedCounter
public Node.ThreadState[] threads
public static final Comparator<Activation.Key> BEGIN_COMP
public static final Comparator<Activation.Key> END_COMP
public static final Comparator<Activation.Key> RID_COMP
protected Node()
public Node(Document doc, int level)
public Node.ThreadState getThreadState(Document doc, boolean create)
public abstract void propagateAddedActivation(Document doc, Activation act, InterprNode conflict)
public abstract void propagateRemovedActivation(Document doc, Activation act)
public abstract boolean isAllowedOption(Document doc, InterprNode n, Activation act, long v)
public abstract void cleanup(Document doc)
public abstract void initActivation(Document doc, Activation act)
public abstract void deleteActivation(Document doc, Activation act)
public abstract String logicToString()
public abstract void apply(Document doc, Activation act, InterprNode conflict)
public abstract void discover(Document doc, Activation act)
protected abstract Collection<AndNode.Refinement> collectNodeAndRefinements(AndNode.Refinement newRef)
protected abstract void changeNumberOfNeuronRefs(Document doc, long v, int d)
protected abstract boolean hasSupport(Activation act)
public abstract void computeNullHyp(Model m)
public abstract boolean isExpandable(boolean checkFrequency)
public void addOrChild(Document doc, OrNode.OrEntry oe)
public void removeOrChild(Document doc, OrNode.OrEntry oe)
public void addAndChild(AndNode.Refinement ref, AndNode child)
public void removeAndChild(AndNode.Refinement ref)
public void count(Document doc)
public Activation addActivationInternal(Document doc, Activation.Key ak, Collection<Activation> inputActs, boolean isTrainingAct)
public boolean removeActivationInternal(Document doc, Activation act, Collection<Activation> inputActs)
public static void addConflict(Document doc, InterprNode io, InterprNode o, Activation act, Collection<Activation> inputActs, long v)
public static void removeConflict(Document doc, InterprNode io, InterprNode o, Activation act, Activation nAct, long v)
public void processChanges(Document doc)
public static void addActivationAndPropagate(Document doc, Activation.Key ak, Collection<Activation> inputActs)
protected Range preProcessAddedActivation(Document doc, Activation.Key ak, Collection<Activation> inputActs)
public void processAddedActivation(Document doc, Activation.Key ak, Collection<Activation> inputActs)
public static void removeActivationAndPropagate(Document doc, Activation act, Collection<Activation> inputActs)
protected void postProcessRemovedActivation(Document doc, Activation act, Collection<Activation> inputActs)
public void processRemovedActivation(Document doc, Activation act, Collection<Activation> inputActs)
public Collection<Activation> getActivations(Document doc)
public Activation getFirstActivation(Document doc)
public void clearActivations(Document doc)
public void clearActivations(Model m)
public boolean isFrequent()
public boolean isPublic()
public boolean computeAndParents(Document doc, Integer offset, SortedSet<AndNode.Refinement> inputs, Map<AndNode.Refinement,Node> parents, boolean discoverPatterns, long v)
public void removeFromNextLevel(Document doc, Activation iAct)
public void remove(Document doc)
public AndNode getAndChild(AndNode.Refinement ref)
public static void computeRefinements(Document doc, TreeSet<Node.RSKey> queue, Neuron n, Node.RSKey rsk, long v, List<Node.RSKey> outputs, List<Node.RSKey> cleanup)
protected void prepareResultsForPredefinedNodes(Document doc, TreeSet<Node.RSKey> queue, long v, List<Node.RSKey> outputs, List<Node.RSKey> cleanup, Neuron n, Synapse s, Integer offset)
public boolean isRequired()
public String toSimpleString()
public String weightsToString()
public void write(DataOutput out) throws IOException
Writableout.write in interface Writableout - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in, Document doc) throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.IOExceptionpublic static Node read(DataInput in, Document doc) throws IOException
IOExceptionpublic int compareTo(Node n)
compareTo in interface Comparable<Node>Copyright © 2017. All rights reserved.