Classes | |
class | CPFFiller |
class | CPFFiller_OR |
class | CPFFiller_ORGrouped |
Public Member Functions | |
AbstractGroundBLN (AbstractBayesianLogicNetwork bln, String databaseFile) throws Exception | |
AbstractGroundBLN (AbstractBayesianLogicNetwork bln, Database db) throws Exception | |
BeliefNode | addHardFormulaNode (String nodeName, Collection< String > parentGAs) throws Exception |
Vector< BeliefNode > | getAuxiliaryVariables () |
AbstractBayesianLogicNetwork | getBLN () |
String | getCPFID (BeliefNode node) |
Database | getDatabase () |
int[] | getFullEvidence (String[][] evidence) |
BeliefNetworkEx | getGroundNetwork () |
ParameterHandler | getParameterHandler () |
RelationalBeliefNetwork | getRBN () |
RelationalNode | getTemplateOf (BeliefNode node) |
void | instantiateGroundNetwork (boolean addAuxiliaryVars) throws Exception |
void | instantiateGroundNetwork () throws Exception |
void | setDebugMode (boolean enabled) |
void | setVerbose (boolean verbose) |
void | show () |
Protected Member Functions | |
Vector< BeliefNode > | connectParents (Map< Integer, String[]> parentGrounding, RelationalNode srcRelNode, BeliefNode targetNode, HashMap< BeliefNode, BeliefNode > src2targetParent, HashMap< BeliefNode, Integer > constantSettings) throws Exception |
void | fillCPFCombiningRule (CPF cpf, int i, int[] addr, Vector< Pair< RelationalNode, Map< BeliefNode, Integer >>> templateDomprodMap, CombiningRule r) |
double | fillCPFCombiningRule_computeColumnEntry (int idx0, int[] addr, Vector< Pair< RelationalNode, Map< BeliefNode, Integer >>> templateDomprodMap, CombiningRule r) |
void | getSubCPFValues (CPF cpf, HashMap< BeliefNode, Integer > constantSettings, int i, int[] addr, Vector< Value > ret) |
Value[] | getSubCPFValues (CPF cpf, HashMap< BeliefNode, Integer > constantSettings) |
abstract void | groundFormulaicNodes () throws Exception |
void | init () |
void | init (AbstractBayesianLogicNetwork bln, Database db) throws Exception |
void | instantiateCPF (Map< Integer, String[]> parentGrounding, RelationalNode srcRelNode, BeliefNode targetNode) throws Exception |
BeliefNode | instantiateVariable (String functionName, String[] params) throws Exception |
void | instantiateVariableFromSingleTemplate (BeliefNode mainNode, RelationalNode relNode, Vector< Map< Integer, String[]>> groundings) throws Exception |
BeliefNode | instantiateVariableWithCombiningRule (BeliefNode mainNode, Vector< Pair< RelationalNode, Vector< Map< Integer, String[]>>>> suitableTemplates, CombiningRule r) throws Exception |
abstract void | onAddGroundAtomNode (RelationalNode relNode, String[] params, BeliefNode instance) |
Protected Attributes | |
AbstractBayesianLogicNetwork | bln |
HashMap< String, Value[]> | cpfCache |
HashMap< BeliefNode, String > | cpfIDs |
String | databaseFile |
Database | db |
boolean | debug = false |
HashMap< String, Vector < RelationalNode > > | functionTemplates |
BeliefNetworkEx | groundBN |
HashMap< BeliefNode, RelationalNode > | groundNode2TemplateNode |
Vector< BeliefNode > | hardFormulaNodes |
HashSet< String > | instantiatedVariables |
ParameterHandler | paramHandler |
boolean | verbose = true |
Definition at line 35 of file AbstractGroundBLN.java.
edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::AbstractGroundBLN | ( | AbstractBayesianLogicNetwork | bln, | |
Database | db | |||
) | throws Exception [inline] |
Definition at line 77 of file AbstractGroundBLN.java.
edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::AbstractGroundBLN | ( | AbstractBayesianLogicNetwork | bln, | |
String | databaseFile | |||
) | throws Exception [inline] |
Definition at line 81 of file AbstractGroundBLN.java.
BeliefNode edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::addHardFormulaNode | ( | String | nodeName, | |
Collection< String > | parentGAs | |||
) | throws Exception [inline] |
adds a node corresponding to a hard constraint to the network - along with the necessary edges
nodeName | name of the node to add for the constraint | |
parentGAs | collection of names of parent nodes/ground atoms |
Exception |
Definition at line 508 of file AbstractGroundBLN.java.
Vector<BeliefNode> edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::connectParents | ( | Map< Integer, String[]> | parentGrounding, | |
RelationalNode | srcRelNode, | |||
BeliefNode | targetNode, | |||
HashMap< BeliefNode, BeliefNode > | src2targetParent, | |||
HashMap< BeliefNode, Integer > | constantSettings | |||
) | throws Exception [inline, protected] |
connects the parents given by the grounding to the target node but does *not* initialize the CPF
parentGrounding | ||
srcRelNode | the relational node that is to serve as the template for the target node | |
targetNode | the node in the ground network to connect the parents to | |
src2targetParent | a mapping in which to store which node in the template model produced which instantiated parent in the ground network (or null) | |
constantSettings | a mapping in which to store bindings of constants (or null) |
Exception |
Definition at line 543 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::fillCPFCombiningRule | ( | CPF | cpf, | |
int | i, | |||
int[] | addr, | |||
Vector< Pair< RelationalNode, Map< BeliefNode, Integer >>> | templateDomprodMap, | |||
CombiningRule | r | |||
) | [inline, protected] |
Definition at line 438 of file AbstractGroundBLN.java.
double edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::fillCPFCombiningRule_computeColumnEntry | ( | int | idx0, | |
int[] | addr, | |||
Vector< Pair< RelationalNode, Map< BeliefNode, Integer >>> | templateDomprodMap, | |||
CombiningRule | r | |||
) | [inline, protected] |
Definition at line 471 of file AbstractGroundBLN.java.
Vector<BeliefNode> edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getAuxiliaryVariables | ( | ) | [inline] |
gets the collection of auxiliary nodes (nodes added for hard formula constraints) contained in this network
Definition at line 846 of file AbstractGroundBLN.java.
AbstractBayesianLogicNetwork edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getBLN | ( | ) | [inline] |
Definition at line 97 of file AbstractGroundBLN.java.
String edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getCPFID | ( | BeliefNode | node | ) | [inline] |
gets the unique identifier of the CPF that is associated with the given ground node of the network
node |
Definition at line 820 of file AbstractGroundBLN.java.
Database edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getDatabase | ( | ) | [inline] |
Definition at line 529 of file AbstractGroundBLN.java.
int [] edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getFullEvidence | ( | String | evidence[][] | ) | [inline] |
adds to the given evidence the evidence that is implied by the hard formulaic constraints (since all of them must be true)
evidence | an array of 2-element arrays containing node name and value |
Definition at line 794 of file AbstractGroundBLN.java.
BeliefNetworkEx edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getGroundNetwork | ( | ) | [inline] |
Definition at line 811 of file AbstractGroundBLN.java.
ParameterHandler edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getParameterHandler | ( | ) | [inline] |
Implements edu::tum::cs::inference::IParameterHandler.
Definition at line 854 of file AbstractGroundBLN.java.
RelationalBeliefNetwork edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getRBN | ( | ) | [inline] |
Definition at line 829 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getSubCPFValues | ( | CPF | cpf, | |
HashMap< BeliefNode, Integer > | constantSettings, | |||
int | i, | |||
int[] | addr, | |||
Vector< Value > | ret | |||
) | [inline, protected] |
Definition at line 665 of file AbstractGroundBLN.java.
Value [] edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getSubCPFValues | ( | CPF | cpf, | |
HashMap< BeliefNode, Integer > | constantSettings | |||
) | [inline, protected] |
Definition at line 657 of file AbstractGroundBLN.java.
RelationalNode edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::getTemplateOf | ( | BeliefNode | node | ) | [inline] |
gets the template (fragment variable) used to instantiate the given ground node
node |
Definition at line 838 of file AbstractGroundBLN.java.
abstract void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::groundFormulaicNodes | ( | ) | throws Exception [protected, pure virtual] |
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::init | ( | ) | [inline, protected] |
Definition at line 495 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::init | ( | AbstractBayesianLogicNetwork | bln, | |
Database | db | |||
) | throws Exception [inline, protected] |
Reimplemented in edu::tum::cs::srl::bayesnets::bln::GroundBLN.
Definition at line 88 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::instantiateCPF | ( | Map< Integer, String[]> | parentGrounding, | |
RelationalNode | srcRelNode, | |||
BeliefNode | targetNode | |||
) | throws Exception [inline, protected] |
connects the parents given by the grounding to the target node and transfers the (correct part of the) CPF to the target node
parentGrounding | a grounding (mapping of indices of relational nodes to an array of actual parameters) | |
srcRelNode | relational node that the CPF is to be copied from | |
targetNode | the target node to connect parents to and whose CPF is to be written |
Exception |
Definition at line 583 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::instantiateGroundNetwork | ( | boolean | addAuxiliaryVars | ) | throws Exception [inline] |
instantiates the ground Bayesian network for this model
addAuxiliaryVars | if true, also adds auxiliary nodes to the network that correspond to the hard logical constraints |
Exception |
Definition at line 114 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::instantiateGroundNetwork | ( | ) | throws Exception [inline] |
instantiates the auxiliary Bayesian network for this model
Exception |
Definition at line 105 of file AbstractGroundBLN.java.
BeliefNode edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::instantiateVariable | ( | String | functionName, | |
String[] | params | |||
) | throws Exception [inline, protected] |
instantiates the variable that corresponds to the given function name and actual parameters by looking for a template and applying it, or simply returns the variable if it was previously instantiated
functionName | ||
params |
Exception |
Definition at line 181 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::instantiateVariableFromSingleTemplate | ( | BeliefNode | mainNode, | |
RelationalNode | relNode, | |||
Vector< Map< Integer, String[]>> | groundings | |||
) | throws Exception [inline, protected] |
instantiates a variable from the given node template for the actual parameters
relNode | the node that is to serve as the template | |
groundings | a vector of node groundings, i.e. mappings from node indices to parameter lists |
Exception |
Definition at line 302 of file AbstractGroundBLN.java.
BeliefNode edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::instantiateVariableWithCombiningRule | ( | BeliefNode | mainNode, | |
Vector< Pair< RelationalNode, Vector< Map< Integer, String[]>>>> | suitableTemplates, | |||
CombiningRule | r | |||
) | throws Exception [inline, protected] |
Definition at line 394 of file AbstractGroundBLN.java.
abstract void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::onAddGroundAtomNode | ( | RelationalNode | relNode, | |
String[] | params, | |||
BeliefNode | instance | |||
) | [protected, pure virtual] |
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::setDebugMode | ( | boolean | enabled | ) | [inline] |
Definition at line 825 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::setVerbose | ( | boolean | verbose | ) | [inline] |
Definition at line 850 of file AbstractGroundBLN.java.
void edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::show | ( | ) | [inline] |
Definition at line 785 of file AbstractGroundBLN.java.
the underlying template model
Definition at line 43 of file AbstractGroundBLN.java.
HashMap<String, Value[]> edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::cpfCache [protected] |
Definition at line 64 of file AbstractGroundBLN.java.
HashMap<BeliefNode, String> edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::cpfIDs [protected] |
maps an instantiated ground node to a string identifying the CPF template that was used to create it
Definition at line 71 of file AbstractGroundBLN.java.
String edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::databaseFile [protected] |
the file from which the evidence database was loaded (if any)
Definition at line 51 of file AbstractGroundBLN.java.
the database for which the ground model was instantiated
Reimplemented in edu::tum::cs::srl::bayesnets::bln::py::GroundBLN.
Definition at line 55 of file AbstractGroundBLN.java.
boolean edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::debug = false [protected] |
Definition at line 66 of file AbstractGroundBLN.java.
HashMap<String, Vector<RelationalNode> > edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::functionTemplates [protected] |
temporary mapping of function names to relational nodes that can serve for instantiation (used only during grounding)
Definition at line 59 of file AbstractGroundBLN.java.
the ground Bayesian network (or ground auxiliary Bayesian network)
Reimplemented in edu::tum::cs::srl::bayesnets::bln::py::GroundBLN.
Definition at line 39 of file AbstractGroundBLN.java.
HashMap<BeliefNode, RelationalNode> edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::groundNode2TemplateNode [protected] |
maps a ground node (in the ground network) to the template node in the fragment network it was instantiated from
Definition at line 75 of file AbstractGroundBLN.java.
Vector<BeliefNode> edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::hardFormulaNodes [protected] |
list of auxiliary nodes contained in the ground Bayesian network (null if the network is not an auxiliary network)
Reimplemented in edu::tum::cs::srl::bayesnets::bln::py::GroundBLN.
Definition at line 47 of file AbstractGroundBLN.java.
HashSet<String> edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::instantiatedVariables [protected] |
temporary storage of names of instantiated variables (to avoid duplicate instantiation during grounding)
Definition at line 63 of file AbstractGroundBLN.java.
Definition at line 67 of file AbstractGroundBLN.java.
boolean edu::tum::cs::srl::bayesnets::bln::AbstractGroundBLN::verbose = true [protected] |
Definition at line 65 of file AbstractGroundBLN.java.