XMM - Probabilistic Models for Motion Recognition and Mapping

xmmGmm.hpp
Go to the documentation of this file.
1 /*
2  * xmmGmm.hpp
3  *
4  * Gaussian Mixture Model for Continuous Recognition and Regression
5  * (Multi-class)
6  *
7  * Contact:
8  * - Jules Francoise <jules.francoise@ircam.fr>
9  *
10  * This code has been initially authored by Jules Francoise
11  * <http://julesfrancoise.com> during his PhD thesis, supervised by Frederic
12  * Bevilacqua <href="http://frederic-bevilacqua.net>, in the Sound Music
13  * Movement Interaction team <http://ismm.ircam.fr> of the
14  * STMS Lab - IRCAM, CNRS, UPMC (2011-2015).
15  *
16  * Copyright (C) 2015 UPMC, Ircam-Centre Pompidou.
17  *
18  * This File is part of XMM.
19  *
20  * XMM is free software: you can redistribute it and/or modify
21  * it under the terms of the GNU General Public License as published by
22  * the Free Software Foundation, either version 3 of the License, or
23  * (at your option) any later version.
24  *
25  * XMM is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28  * GNU General Public License for more details.
29  *
30  * You should have received a copy of the GNU General Public License
31  * along with XMM. If not, see <http://www.gnu.org/licenses/>.
32  */
33 
34 #ifndef xmmGmm_h
35 #define xmmGmm_h
36 
37 #include "../../core/distributions/xmmGaussianDistribution.hpp"
38 #include "../../core/model/xmmModel.hpp"
39 #include "xmmGmmSingleClass.hpp"
40 
41 namespace xmm {
47 class GMM : public Model<SingleClassGMM, GMM> {
48  public:
53  GMM(bool bimodal = false);
54 
59  GMM(GMM const& src);
60 
65  explicit GMM(Json::Value const& root);
66 
71  GMM& operator=(GMM const& src);
72 
74 
79  virtual void reset();
80 
87  virtual void filter(std::vector<float> const& observation);
88 
90 
91  //
92  // /**
93  // @brief Convert to bimodal GMM in place
94  // @param dimension_input dimension of the input modality
95  // @throws runtime_error if the model is already bimodal
96  // @throws out_of_range if the requested input dimension is too
97  // large
98  // */
99  // void makeBimodal(unsigned int dimension_input);
100  //
101  // /**
102  // @brief Convert to unimodal GMM in place
103  // @throws runtime_error if the model is already unimodal
104  // */
105  // void makeUnimodal();
106  //
107  // /**
108  // @brief extract a submodel with the given columns
109  // @param columns columns indices in the target order
110  // @throws runtime_error if the model is training
111  // @throws out_of_range if the number or indices of the requested
112  // columns exceeds the current dimension
113  // @return a GMM from the current model considering only the target
114  // columns
115  // */
116  // GMM extractSubmodel(std::vector<unsigned int>& columns) const;
117  //
118  // /**
119  // @brief extract the submodel of the input modality
120  // @throws runtime_error if the model is training or if it is not
121  // bimodal
122  // @return a unimodal GMM of the input modality from the current
123  // bimodal model
124  // */
125  // GMM extractSubmodel_input() const;
126  //
127  // /**
128  // @brief extract the submodel of the output modality
129  // @throws runtime_error if the model is training or if it is not
130  // bimodal
131  // @return a unimodal GMM of the output modality from the current
132  // bimodal model
133  // */
134  // GMM extractSubmodel_output() const;
135  //
136  // /**
137  // @brief extract the model with reversed input and output
138  // modalities
139  // @throws runtime_error if the model is training or if it is not
140  // bimodal
141  // @return a bimodal GMM that swaps the input and output modalities
142  // */
143  // GMM extract_inverse_model() const;
144 
149 
150  protected:
154  virtual void updateResults();
155 };
156 }
157 
158 #endif
Results of the filtering/inference process (for a Model with multiple classes).
Definition: xmmModelResults.hpp:80
virtual void updateResults()
Update the results (Likelihoods)
Definition: xmmGmm.cpp:52
GMM & operator=(GMM const &src)
Assignment.
Definition: xmmGmm.cpp:44
GMM(bool bimodal=false)
Constructor.
Definition: xmmGmm.cpp:37
Probabilistic machine learning model for multiclass recognition and regression.
Definition: xmmModel.hpp:52
Gaussian Mixture Model for Continuous Recognition and Regression (Multi-class)
Definition: xmmGmm.hpp:47
Results< GMM > results
Convert to bimodal GMM in place.
Definition: xmmGmm.hpp:148
Definition: xmmAttribute.hpp:42
virtual void reset()
Resets the fitering process (recognition or regression)
Definition: xmmGmm.cpp:86
virtual void filter(std::vector< float > const &observation)
filters a incoming observation (performs recognition or regression)
Definition: xmmGmm.cpp:108