XMM - Probabilistic Models for Motion Recognition and Mapping

xmmKMeansParameters.hpp
Go to the documentation of this file.
1 /*
2  * xmmKMeansParameters.hpp
3  *
4  * Parameters of the K-Means clustering Algorithm
5  *
6  * Contact:
7  * - Jules Francoise <jules.francoise@ircam.fr>
8  *
9  * This code has been initially authored by Jules Francoise
10  * <http://julesfrancoise.com> during his PhD thesis, supervised by Frederic
11  * Bevilacqua <href="http://frederic-bevilacqua.net>, in the Sound Music
12  * Movement Interaction team <http://ismm.ircam.fr> of the
13  * STMS Lab - IRCAM, CNRS, UPMC (2011-2015).
14  *
15  * Copyright (C) 2015 UPMC, Ircam-Centre Pompidou.
16  *
17  * This File is part of XMM.
18  *
19  * XMM is free software: you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation, either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * XMM is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with XMM. If not, see <http://www.gnu.org/licenses/>.
31  */
32 
33 #ifndef xmmKMeansParameters_hpp
34 #define xmmKMeansParameters_hpp
35 
36 #include "../../core/model/xmmModelParameters.hpp"
37 
38 namespace xmm {
46 class KMeans;
47 
52 template <>
53 class ClassParameters<KMeans> : public Writable {
54  public:
59 
65 
70  explicit ClassParameters(Json::Value const& root);
71 
77 
78  virtual ~ClassParameters() {}
79 
81 
87  Json::Value toJson() const;
88 
94  virtual void fromJson(Json::Value const& root);
95 
97 
101  bool changed = false;
102 
107 
112 
118 
119  protected:
123  virtual void onAttributeChange(AttributeBase* attr_pointer);
124 };
125 }
126 
127 #endif
bool changed
specifies if parameters have changed (model is invalid)
Definition: xmmModelParameters.hpp:76
virtual ~ClassParameters()
Definition: xmmKMeansParameters.hpp:78
ClassParameters & operator=(ClassParameters const &src)
Assignment.
Definition: xmmModelParameters.hpp:71
Parameters specific to each class of a K-Means Algorithm.
Definition: xmmKMeansParameters.hpp:53
Base Class for Generic Attributes.
Definition: xmmAttribute.hpp:105
Attribute< unsigned int > clusters
Number of Gaussian Mixture Components.
Definition: xmmKMeansParameters.hpp:106
virtual Json::Value toJson() const =0
Write the object to a JSON Structure.
Attribute< unsigned int > max_iterations
Maximum number of iterations of the training update.
Definition: xmmKMeansParameters.hpp:111
K-Means Clustering algorithm.
Definition: xmmKMeans.hpp:46
Abstract class for handling JSON + File I/O.
Definition: xmmJson.hpp:50
ClassParameters()
Default Constructor.
Definition: xmmModelParameters.hpp:53
Definition: xmmAttribute.hpp:42
virtual void fromJson(Json::Value const &root)=0
Read the object from a JSON Structure.
Class-specific Model Parameters.
Definition: xmmModelParameters.hpp:48
Attribute< float > relative_distance_threshold
threshold (as relative distance between cluster) required to define convergence
Definition: xmmKMeansParameters.hpp:117