GMMParameterEstimator.h
Go to the documentation of this file.
1 
18 #pragma once
19 
20 // Global includes
21 #include <random>
22 #include <string>
23 #include <vector>
24 #include <chrono>
25 
26 // Package includes
27 #include <Eigen/Core>
28 #include <Eigen/Geometry>
29 #include <Eigen/Eigenvalues>
30 
31 #include <boost/lexical_cast.hpp>
32 #include <boost/property_tree/ptree.hpp>
33 
34 #include <asr_msgs/AsrObject.h>
35 
36 #include <Pose.h>
37 
38 #include <opencv2/opencv.hpp>
39 
40 #include <visualization/gnuplot/GMMGnuplotVisualization.h>
41 
42 // Local includes.
44 
45 #include "helper/MathHelper.h"
46 
48 
58  public:
59 
73  GMMParameterEstimator(unsigned int pNumberOfDimensions, unsigned int pNumberOfKernelsMin, unsigned int pNumberOfKernelsMax, unsigned int pNumberOfRuns, unsigned int pNumberOfSyntheticSamples, double pIntervalPosition, double pIntervalOrientation, std::string pPathOrientationPlots, unsigned int pAttemptsPerKernel);
74 
79 
85  void addDatum(Eigen::Vector3d pSample);
86 
92  void addDatum(Eigen::Quaternion<double> pSample);
93 
97  void learn();
98 
104  void getModel(GaussianMixtureModel& gmm);
105 
109  void plotModel();
110 
111  private:
112 
126  bool runExpectationMaximization(const std::vector<std::vector<double>> data,
127  unsigned int nc,
128  unsigned int& nparams,
129  double& llk,
130  double& bic,
131  GaussianMixtureModel& model,
132  bool useGenericMatrices = true);
133 
137  unsigned int mNumberDimensions;
138 
144 
148  unsigned int mNumberOfRuns;
149 
154 
159 
164 
168  unsigned int mAttemptsPerRun;
169 
173  std::vector<std::vector<double> > mData;
174 
179  };
180 }
bool runExpectationMaximization(const std::vector< std::vector< double >> data, unsigned int nc, unsigned int &nparams, double &llk, double &bic, GaussianMixtureModel &model, bool useGenericMatrices=true)
GMMParameterEstimator(unsigned int pNumberOfDimensions, unsigned int pNumberOfKernelsMin, unsigned int pNumberOfKernelsMax, unsigned int pNumberOfRuns, unsigned int pNumberOfSyntheticSamples, double pIntervalPosition, double pIntervalOrientation, std::string pPathOrientationPlots, unsigned int pAttemptsPerKernel)


asr_psm
Author(s): Braun Kai, Gehrung Joachim, Heizmann Heinrich, Meißner Pascal
autogenerated on Fri Nov 15 2019 03:57:54