public class AndNode extends Node<AndNode,NodeActivation<AndNode>>
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 pattern lattice is organized in layers, where each layer only contains conjunctions/patterns of the
same size. These layers are connected through refinements. For example the and-node
ABD on layer 3 is connected to the and-node ABCD on layer 4 via the refinement C.| Modifier and Type | Class and Description |
|---|---|
static class |
AndNode.Refinement |
Node.RidVisited, Node.ThreadState<T extends Node,A extends NodeActivation<T>>| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_AND_NODE_SIZE |
static int |
MAX_NODES |
static int |
MAX_RID_RANGE |
int |
numberOfPositionsNotify |
BEGIN_COMP, END_COMP, endRequired, frequency, frequencyHasChanged, instanceSum, isDiscovered, isQueued, level, lock, MAX_NODE, MAX_RID, MIN_NODE, nOffset, nullHypFreq, numberOfNeuronRefs, oldNullHypFreq, queueId, RID_COMP, ridRequired, sizeSum, threads, visitedCounterlastUsedDocumentId, provider| Constructor and Description |
|---|
AndNode() |
AndNode(Model m,
int level,
SortedMap<AndNode.Refinement,Provider<? extends Node>> parents) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addNextLevelActivation(Document doc,
NodeActivation<AndNode> act,
NodeActivation<AndNode> secondAct,
Provider<AndNode> pnlp,
InterprNode conflict) |
void |
changeNumberOfNeuronRefs(int threadId,
long v,
int d) |
void |
cleanup(Model m) |
static SortedMap<AndNode.Refinement,Provider<? extends Node>> |
computeNextLevelParents(Model m,
int threadId,
Node pa,
AndNode.Refinement ref,
boolean discoverPatterns) |
int |
computeNotify(double x) |
void |
computeNullHyp(Model m) |
double |
computeSynapseWeightSum(Integer offset,
INeuron n) |
protected NodeActivation<AndNode> |
createActivation(Document doc,
NodeActivation.Key ak,
boolean isTrainingAct) |
static AndNode |
createNextLevelNode(Model m,
int threadId,
Node n,
AndNode.Refinement ref,
boolean discoverPatterns) |
void |
deleteActivation(Document doc,
NodeActivation act) |
void |
discover(Document doc,
NodeActivation<AndNode> act,
TrainConfig trainConfig) |
boolean |
isAllowedOption(int threadId,
InterprNode n,
NodeActivation<?> act,
long v) |
boolean |
isCovered(int threadId,
Integer offset,
long v) |
boolean |
isExpandable() |
String |
logicToString() |
static Collection<NodeActivation<?>> |
prepareInputActs(NodeActivation<?> firstAct,
NodeActivation<?> secondAct) |
void |
propagateAddedActivation(Document doc,
NodeActivation act,
InterprNode removedConflict)
Propagate an activation to the next node or the next neuron that is depending on the current node.
|
void |
propagateRemovedActivation(Document doc,
NodeActivation act) |
void |
readFields(DataInput in,
Model m)
Deserialize the fields of this object from
in. |
void |
updateWeight(Document doc,
TrainConfig trainConfig,
long v) |
String |
weightsToString() |
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
addActivationAndPropagate, clearActivations, clearActivations, clearActivations, compareTo, count, getActivations, getFirstActivation, getNeuronLabel, getThreadState, isPublic, isRequired, processChanges, readNode, register, removeActivationAndPropagate, toString, unregisterreactivate, read, suspendpublic static int MAX_AND_NODE_SIZE
public static int MAX_NODES
public static int MAX_RID_RANGE
public volatile int numberOfPositionsNotify
public AndNode()
public AndNode(Model m, int level, SortedMap<AndNode.Refinement,Provider<? extends Node>> parents)
public boolean isAllowedOption(int threadId,
InterprNode n,
NodeActivation<?> act,
long v)
isAllowedOption in class Node<AndNode,NodeActivation<AndNode>>public void propagateAddedActivation(Document doc, NodeActivation act, InterprNode removedConflict)
NodepropagateAddedActivation in class Node<AndNode,NodeActivation<AndNode>>public void propagateRemovedActivation(Document doc, NodeActivation act)
propagateRemovedActivation in class Node<AndNode,NodeActivation<AndNode>>public void computeNullHyp(Model m)
computeNullHyp in class Node<AndNode,NodeActivation<AndNode>>public void updateWeight(Document doc, TrainConfig trainConfig, long v)
public int computeNotify(double x)
public void cleanup(Model m)
cleanup in class Node<AndNode,NodeActivation<AndNode>>public void discover(Document doc, NodeActivation<AndNode> act, TrainConfig trainConfig)
discover in class Node<AndNode,NodeActivation<AndNode>>public boolean isExpandable()
isExpandable in class Node<AndNode,NodeActivation<AndNode>>public static AndNode createNextLevelNode(Model m, int threadId, Node n, AndNode.Refinement ref, boolean discoverPatterns)
public static void addNextLevelActivation(Document doc, NodeActivation<AndNode> act, NodeActivation<AndNode> secondAct, Provider<AndNode> pnlp, InterprNode conflict)
public void changeNumberOfNeuronRefs(int threadId,
long v,
int d)
changeNumberOfNeuronRefs in class Node<AndNode,NodeActivation<AndNode>>public static Collection<NodeActivation<?>> prepareInputActs(NodeActivation<?> firstAct, NodeActivation<?> secondAct)
public static SortedMap<AndNode.Refinement,Provider<? extends Node>> computeNextLevelParents(Model m, int threadId, Node pa, AndNode.Refinement ref, boolean discoverPatterns)
public boolean isCovered(int threadId,
Integer offset,
long v)
throws Node.ThreadState.RidOutOfRange
isCovered in class Node<AndNode,NodeActivation<AndNode>>Node.ThreadState.RidOutOfRangepublic double computeSynapseWeightSum(Integer offset, INeuron n)
computeSynapseWeightSum in class Node<AndNode,NodeActivation<AndNode>>protected NodeActivation<AndNode> createActivation(Document doc, NodeActivation.Key ak, boolean isTrainingAct)
public void deleteActivation(Document doc, NodeActivation act)
public String logicToString()
logicToString in class Node<AndNode,NodeActivation<AndNode>>public String weightsToString()
weightsToString in class Node<AndNode,NodeActivation<AndNode>>public void write(DataOutput out) throws IOException
Writableout.write in interface Writablewrite in class Node<AndNode,NodeActivation<AndNode>>out - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in, Model m) throws IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface WritablereadFields in class Node<AndNode,NodeActivation<AndNode>>in - DataInput to deseriablize this object from.IOExceptionCopyright © 2017. All rights reserved.