aGrUM  0.13.2
GibbsKL.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
31 #ifndef GUM_GIBBS_KL2_H
32 #define GUM_GIBBS_KL2_H
33 
37 
39 
40 namespace gum {
41 
75  template < typename GUM_SCALAR >
76  class GibbsKL
77  : public KL< GUM_SCALAR >
78  , public ApproximationScheme
79  , public GibbsOperator< GUM_SCALAR > {
80  public:
81  /* no default constructor */
82 
91 
94  explicit GibbsKL(const KL< GUM_SCALAR >& kl);
95 
97  ~GibbsKL();
98 
104  void setBurnIn(Size b);
105 
110  Size burnIn() const;
111 
112  protected:
113  void _computeKL() final;
114 
115  using KL< GUM_SCALAR >::_p;
116  using KL< GUM_SCALAR >::_q;
119 
122 
125  };
126 
127 
128  extern template class GibbsKL< float >;
129  extern template class GibbsKL< double >;
130 
131 
132 } // namespace gum
133 
135 
136 #endif
algorithm for KL divergence between BNs
unsigned long Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:50
GibbsKL(const IBayesNet< GUM_SCALAR > &P, const IBayesNet< GUM_SCALAR > &Q)
constructor must give 2 BNs
Definition: GibbsKL_tpl.h:50
This file contains Gibbs sampling (for BNs) class definitions.
This file contains general scheme for iteratively convergent algorithms.
Approximation Scheme.
GibbsKL computes the KL divergence betweens 2 BNs using an approximation pattern: GIBBS sampling...
Definition: GibbsKL.h:76
Size burnIn() const
Returns the number of burn in.
Definition: GibbsKL_tpl.h:180
void _computeKL() final
Definition: GibbsKL_tpl.h:97
~GibbsKL()
destructor
Definition: GibbsKL_tpl.h:92
Class representing the minimal interface for Bayesian Network.
Definition: IBayesNet.h:59
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Classes of signaler.
void setBurnIn(Size b)
Number of burn in for one iteration.
Definition: GibbsKL_tpl.h:175
KL divergence between BNs – implementation using Gibbs sampling.
KL is the base class for KL computation betweens 2 BNs.
Definition: KL.h:65
class containing all variables and methods required for Gibbssampling
Definition: gibbsOperator.h:47