Class Node<T extends Node,​A extends NodeActivation<T>>

  • All Implemented Interfaces:
    Comparable<Node>, Writable
    Direct Known Subclasses:
    AndNode, InputNode, OrNode

    public abstract class Node<T extends Node,​A extends NodeActivation<T>>
    extends AbstractNode<Provider<T>>
    implements Comparable<Node>
    The 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.

    Author:
    Lukas Molzberger
    • Field Detail

      • MIN_NODE

        public static final Node MIN_NODE
      • MAX_NODE

        public static final Node MAX_NODE
      • level

        public int level
    • Constructor Detail

      • Node

        protected Node()
      • Node

        public Node​(Model m,
                    int level)
    • Method Detail

      • propagate

        protected abstract void propagate​(A act)
        Propagate an activation to the next node or the next neuron that is depending on the current node.
        Parameters:
        act -
      • clearThreadState

        public void clearThreadState​(int threadId,
                                     int deleteDocId)
      • reprocessInputs

        public abstract void reprocessInputs​(Document doc)
      • cleanup

        public abstract void cleanup()
      • logicToString

        public abstract String logicToString()
      • postCreate

        public void postCreate​(Document doc)
      • register

        public void register​(A act)
      • clearActivations

        public void clearActivations​(Document doc)
      • clearActivations

        public void clearActivations​(int threadId)
      • clearActivations

        public void clearActivations()
      • processChanges

        public void processChanges​(Document doc)
        Process all added or removed activation for this logic node.
        Parameters:
        doc -
      • propagateToOrNode

        protected void propagateToOrNode​(NodeActivation inputAct)
      • addActivation

        public void addActivation​(A act)
        Add a new activation to this logic node and further propagate this activation through the network. This activation, however, will not be added immediately. This method only adds a request to the activations queue in the document. The activation will be added when the method Node.processChanges(Document doc) is called.
        Parameters:
        act -
      • remove

        public void remove()
      • isRequired

        public boolean isRequired()
      • changeNumberOfNeuronRefs

        protected void changeNumberOfNeuronRefs​(int threadId,
                                                long v,
                                                int d)
      • getNeuronLabel

        public String getNeuronLabel()
      • isQueued

        public boolean isQueued​(int threadId,
                                long queueId)
      • setNotQueued

        public void setNotQueued​(int threadId)
      • compareRank

        public static int compareRank​(int threadId,
                                      Node n1,
                                      Node n2)