50#ifndef GUM_GIBBS_OPERATOR_H
51#define GUM_GIBBS_OPERATOR_H
69 template < GUM_Numeric GUM_SCALAR >
78 bool atRandom =
false);
93 const std::string& section);
176 void _mask_(
NodeId node, Tensor< GUM_SCALAR >& p)
const;
195#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Class representing the minimal interface for Bayesian network with no numerical data.
NodeProperty< std::vector< bool > > _allowed_
the values of each node that may belong to a sample with a positive probability
void setDrawnAtRandom(bool atRandom)
void _smoothedGibbsSample_(NodeId id, Instantiation *I, GUM_SCALAR epsilon)
Size nbrDrawnVar() const
Getters and setters.
void _drawVarMonteCarlo_(NodeId nod, Instantiation *I)
static constexpr Size _nbrSweepsBySmoothingLevel_
maximal number of sweeps (over the non-evidence nodes) for each smoothing level
void setNbrDrawnVar(Size nbr)
bool _isCompatible_(const Instantiation &I) const
static constexpr std::array< double, 4 > _smoothingLevels_
growing smoothing levels: a null probability is replaced by epsilon times the smallest positive proba...
const IBayesNet< GUM_SCALAR > & samplingBn_
void _GibbsSample_(NodeId id, Instantiation *I)
change in Instantiation I a new drawn value for id
Instantiation nextSample(Instantiation prev)
draws next sample of Gibbs sampling
Instantiation _forwardSample_()
Sequence< NodeId > samplingNodes_
Instantiation monteCarloSample()
draws a first sample with a positive probability (starting point of a Gibbs chain)
const NodeProperty< Idx > * hardEv_
static constexpr Size _nbrSmoothingRestarts_
number of restarts (from a new forward sample) of the smoothed Gibbs moves
bool isDrawnAtRandom() const
GibbsOperator(const IBayesNet< GUM_SCALAR > &BN, const NodeProperty< Idx > *hardEv, Size nbr=1, bool atRandom=false)
constructor
void _mask_(NodeId node, Tensor< GUM_SCALAR > &p) const
static constexpr Size _nbrRejectionTries_
number of forward samples drawn before searching a compatible sample by smoothed Gibbs moves
void updateSamplingNodes_()
NodeProperty< GUM_SCALAR > _minNonZero_
the smallest positive probability of the CPT of each node (for the smoothed Gibbs moves)
Class representing the minimal interface for Bayesian network with no numerical data.
Class for assigning/browsing values to tuples of discrete variables.
Implementation of Gibbs inference methods in Bayesian networks.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
gum is the global namespace for all aGrUM entities
template class GUM_PUBLIC_BN GibbsOperator< double >