50#ifndef GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H
51#define GUM_BAYES_NET_MARGINAL_TARGETED_INFERENCE_H
75 template <
typename GUM_SCALAR >
133 virtual const Tensor< GUM_SCALAR >&
posterior(
const std::string& nodeName);
158 virtual void addTarget(
const std::string& nodeName)
final;
168 virtual void eraseTarget(
const std::string& nodeName)
final;
174 virtual bool isTarget(
const std::string& nodeName)
const final;
196 virtual GUM_SCALAR
H(
NodeId X)
final;
202 virtual GUM_SCALAR
H(
const std::string& nodeName)
final;
231 const std::vector< std::string >& evs);
This file contains abstract class definitions for Bayesian networks inference classes.
BayesNetInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor
Virtual base class for probabilistic graphical models.
Class representing the minimal interface for Bayesian network with no numerical data.
NodeSet _targets_
the set of marginal targets
virtual Size nbrTargets() const noexcept final
returns the number of marginal targets
virtual bool isInTargetMode() const noexcept final
indicates whether the inference is in a target mode
bool isTargetedMode_() const
virtual const Tensor< GUM_SCALAR > & posterior(NodeId node)
Computes and returns the posterior of a node.
virtual void eraseTarget(NodeId target) final
removes an existing (marginal) target
virtual void onAllMarginalTargetsErased_()=0
fired before a all marginal targets are removed
void _setAllMarginalTargets_()
sets all the nodes of the Bayes net as targets
virtual const Tensor< GUM_SCALAR > & posterior_(NodeId id)=0
asks derived classes for the posterior of a given variable
virtual void onMarginalTargetErased_(const NodeId id)=0
fired before a marginal target is removed
virtual void eraseAllTargets()
Clear all previously defined targets.
virtual void onAllMarginalTargetsAdded_()=0
fired after all the nodes of the BN are added as marginal targets
virtual GUM_SCALAR H(NodeId X) final
Entropy Compute Shanon's entropy of a node given the observation.
bool _targeted_mode_
whether the actual targets are default
virtual const NodeSet & targets() const noexcept final
returns the list of marginal targets
MarginalTargetedInference(const IBayesNet< GUM_SCALAR > *bn)
default constructor
virtual bool isTarget(NodeId node) const final
return true if variable is a (marginal) target
virtual void addTarget(NodeId target) final
Add a marginal target to the list of targets.
virtual void addAllTargets() final
adds all nodes as targets
virtual void onModelChanged_(const GraphicalModel *bn)
fired after a new Bayes net has been assigned to the engine
virtual void onMarginalTargetAdded_(const NodeId id)=0
fired after a new marginal target is inserted
virtual ~MarginalTargetedInference()
destructor
Tensor< GUM_SCALAR > evidenceImpact(NodeId target, const NodeSet &evs)
Create a gum::Tensor for P(target|evs) (for all instanciation of target and evs).
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 generic class for the computation of (possibly incrementally) marginal posterio...
gum is the global namespace for all aGrUM entities