Class SearchNode

  • All Implemented Interfaces:
    java.lang.Comparable<SearchNode>

    public class SearchNode
    extends java.lang.Object
    implements java.lang.Comparable<SearchNode>
    The SearchNode class represents a node in the binary search tree that is used to find the optimal interpretation for a given document. Each search node possess a refinement (simply a set of interpretation nodes). The two options that this search node examines are that the refinement will either part of the final interpretation or not. During each search step the activation values in all the neuron activations adjusted such that they reflect the interpretation of the current search path. When the search reaches the maximum depth of the search tree and no further refinements exists, a weight is computed evaluating the current search path. The search path with the highest weight is used to determine the final interpretation.

    Before the search is started a set of initial refinements is generated from the conflicts within the document. In other words, if there are no conflicts in a given document, then no search is needed. In this case the final interpretation will simply be the set of all interpretation nodes. The initial refinements are then expanded, meaning all interpretation nodes that are consistent with this refinement are added to the refinement. The initial refinements are then propagated along the search path as refinement candidates.

    Author:
    Lukas Molzberger
    • Field Detail

      • MAX_SEARCH_STEPS

        public static int MAX_SEARCH_STEPS
      • ENABLE_CACHING

        public static boolean ENABLE_CACHING
      • OPTIMIZE_SEARCH

        public static boolean OPTIMIZE_SEARCH
      • COMPUTE_SOFT_MAX

        public static boolean COMPUTE_SOFT_MAX
    • Method Detail

      • getId

        public int getId()
      • getAccumulatedWeight

        public double getAccumulatedWeight()
      • getActivation

        public Activation getActivation()
      • compareNewState

        public boolean compareNewState​(SearchNode cachedNode)
      • dumpDebugState

        public void dumpDebugState()
      • search

        public static void search​(Document doc,
                                  SearchNode root,
                                  long v,
                                  java.lang.Long timeoutInMilliSeconds)
                           throws SearchNode.TimeoutException
        Searches for the best interpretation for the given document. This implementation of the algorithm is iterative to prevent stack overflow errors from happening. Depending on the document the search tree might be getting very deep.
        Parameters:
        doc -
        root -
        Throws:
        SearchNode.TimeoutException
      • getWeightSum

        public double getWeightSum()
      • getAlternative

        public SearchNode getAlternative()
      • invalidateCachedDecision

        public static void invalidateCachedDecision​(Activation act)
      • computeCachedFactor

        public static void computeCachedFactor​(SearchNode sn)
      • pathToString

        public java.lang.String pathToString()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(SearchNode sn)
        Specified by:
        compareTo in interface java.lang.Comparable<SearchNode>