public class SearchNode extends Object implements Comparable<SearchNode>
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
SearchNode.DebugState |
static class |
SearchNode.Decision |
static class |
SearchNode.TimeoutException |
| Modifier and Type | Field and Description |
|---|---|
double |
accumulatedWeight |
Candidate |
candidate |
static boolean |
COMPUTE_SOFT_MAX |
static boolean |
ENABLE_CACHING |
int |
id |
static int |
MAX_SEARCH_STEPS |
Map<Activation,Activation.StateChange> |
modifiedActs |
static boolean |
OPTIMIZE_SEARCH |
| Constructor and Description |
|---|
SearchNode(Document doc,
SearchNode selParent,
SearchNode exclParent,
int level) |
| Modifier and Type | Method and Description |
|---|---|
void |
changeState(Activation.Mode m) |
boolean |
compareNewState(SearchNode cachedNode) |
int |
compareTo(SearchNode sn) |
void |
dumpDebugState() |
SearchNode.Decision |
getDecision() |
SearchNode |
getParent() |
static void |
invalidateCachedDecision(Activation act) |
String |
pathToString() |
static void |
search(Document doc,
SearchNode root,
long v,
Long timeoutInMilliSeconds)
Searches for the best interpretation for the given document.
|
String |
toString() |
public static int MAX_SEARCH_STEPS
public static boolean ENABLE_CACHING
public static boolean OPTIMIZE_SEARCH
public static boolean COMPUTE_SOFT_MAX
public int id
public Candidate candidate
public double accumulatedWeight
public Map<Activation,Activation.StateChange> modifiedActs
public SearchNode(Document doc, SearchNode selParent, SearchNode exclParent, int level)
public boolean compareNewState(SearchNode cachedNode)
public void dumpDebugState()
public static void search(Document doc, SearchNode root, long v, Long timeoutInMilliSeconds) throws SearchNode.TimeoutException
doc - root - SearchNode.TimeoutExceptionpublic static void invalidateCachedDecision(Activation act)
public String pathToString()
public void changeState(Activation.Mode m)
public int compareTo(SearchNode sn)
compareTo in interface Comparable<SearchNode>public SearchNode getParent()
public SearchNode.Decision getDecision()
Copyright © 2018. All rights reserved.