50#ifndef GUM_BAYES_NET_JOINT_TARGETED_INFERENCE_H
51#define GUM_BAYES_NET_JOINT_TARGETED_INFERENCE_H
77 template < GUM_Numeric GUM_SCALAR >
150 const Tensor< GUM_SCALAR >&
posterior(std::string_view nodeName)
final;
221 const std::vector< std::string >& evs);
243 GUM_SCALAR
I(std::string_view Xname, std::string_view Yname);
261 GUM_SCALAR
VI(std::string_view Xname, std::string_view Yname);
310 const NodeSet& declared_target) = 0;
Virtual base class for probabilistic graphical models.
Class representing the minimal interface for Bayesian network with no numerical data.
GUM_SCALAR VI(std::string_view Xname, std::string_view Yname)
Variation of information between X and Y.
const Tensor< GUM_SCALAR > & posterior(NodeId node) final
Computes and returns the posterior of a node.
GUM_SCALAR I(NodeId X, NodeId Y)
Mutual information between X and Y.
~JointTargetedInference() override
destructor
Tensor< GUM_SCALAR > evidenceJointImpact(const NodeSet &targets, const NodeSet &evs)
Create a gum::Tensor for P(joint targets|evs) (for all instantiation of targets and evs).
GUM_SCALAR VI(NodeId X, NodeId Y)
Variation of information between X and Y.
virtual Size nbrJointTargets() const noexcept final
returns the number of joint targets
virtual void onAllJointTargetsErased_()=0
fired before a all the joint targets are removed
virtual Tensor< GUM_SCALAR > * unnormalizedJointPosterior_(NodeId id)=0
returns a fresh tensor equal to P(argument,evidence)
Set< NodeSet > _joint_targets_
the set of joint targets
virtual void eraseAllMarginalTargets() final
Clear all the previously defined marginal targets.
virtual void onJointTargetErased_(const NodeSet &set)=0
fired before a joint target is removed
virtual bool isJointTarget(const NodeSet &vars) const final
return true if target is a joint target.
virtual void addJointTarget(const NodeSet &joint_target) final
Add a set of nodes as a new joint target. As a collateral effect, every node is added as a marginal t...
virtual void onJointTargetAdded_(const NodeSet &set)=0
fired after a new joint target is inserted
JointTargetedInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor
virtual Tensor< GUM_SCALAR > * unnormalizedJointPosterior_(const NodeSet &set)=0
returns a fresh unnormalized joint posterior of a given set of variables
virtual const Tensor< GUM_SCALAR > & jointPosterior_(const NodeSet &set)=0
asks derived classes for the joint posterior of a declared target set
virtual void eraseAllJointTargets() final
Clear all previously defined joint targets.
virtual const Set< NodeSet > & jointTargets() const noexcept final
returns the list of joint targets
void eraseAllTargets() override
Clear all previously defined targets (marginal and joint targets).
virtual const Tensor< GUM_SCALAR > & jointPosterior_(const NodeSet &wanted_target, const NodeSet &declared_target)=0
asks derived classes for the joint posterior of a set of variables not declared as a joint target
GUM_SCALAR I(std::string_view Xname, std::string_view Yname)
Mutual information between X and Y.
virtual const Tensor< GUM_SCALAR > & jointPosterior(const NodeSet &nodes) final
Compute the joint posterior of a set of nodes.
void onModelChanged_(const GraphicalModel *bn) override
fired after a new Bayes net has been assigned to the engine
virtual void onAllTargetsErased_()=0
fired before a all the marginal and joint targets are removed
virtual void eraseJointTarget(const NodeSet &joint_target) final
removes an existing joint target
GUM_SCALAR jointMutualInformation(const NodeSet &targets)
Mutual information between targets.
MarginalTargetedInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor
virtual const NodeSet & targets() const noexcept final
returns the list of marginal targets
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
Implementation of the non pure virtual methods of class JointTargetedInference.
This file contains the abstract inference class definition for computing (incrementally) marginal pos...
gum is the global namespace for all aGrUM entities