|
DMP_BBO library
|
Model parameters for the GMR function approximator. More...
#include <ModelParametersGMR.hpp>


Public Member Functions | |
| ModelParametersGMR (std::vector< double > priors, std::vector< Eigen::VectorXd > means, std::vector< Eigen::MatrixXd > covars, int n_output_dims=1) | |
| Constructor for the model parameters of the GMR function approximator. | |
| ModelParametersGMR (std::vector< double > priors, std::vector< Eigen::VectorXd > mu_xs, std::vector< Eigen::VectorXd > mu_ys, std::vector< Eigen::MatrixXd > sigma_xs, std::vector< Eigen::MatrixXd > sigma_ys, std::vector< Eigen::MatrixXd > sigma_x_ys) | |
| Constructor for the model parameters of the GMR function approximator. | |
| ModelParametersGMR (int n_observations, std::vector< double > priors, std::vector< Eigen::VectorXd > means, std::vector< Eigen::MatrixXd > covars, int n_output_dims=1) | |
| Constructor for the model parameters of the GMR function approximator (Used by the incremental training). | |
| ModelParametersGMR (int n_observations, std::vector< double > priors, std::vector< Eigen::VectorXd > mu_xs, std::vector< Eigen::VectorXd > mu_ys, std::vector< Eigen::MatrixXd > sigma_xs, std::vector< Eigen::MatrixXd > sigma_ys, std::vector< Eigen::MatrixXd > sigma_x_ys) | |
| Constructor for the model parameters of the GMR function approximator (Used by the incremental training). | |
| unsigned int | getNumberOfGaussians (void) const |
| Get the number of Gaussians in the GMM. More... | |
| virtual int | getExpectedOutputDim (void) const |
| The expected dimensionality of the output data. More... | |
| virtual int | getExpectedInputDim (void) const |
| The expected dimensionality of the input data. More... | |
| std::string | toString (void) const |
| Returns a string representation of the object. More... | |
| ModelParameters * | clone (void) const |
| Return a pointer to a deep copy of the ModelParameters object. More... | |
| void | getSelectableParameters (std::set< std::string > &selected_values_labels) const |
| Return all the names of the parameter types that can be selected. More... | |
| void | getParameterVectorMask (const std::set< std::string > selected_values_labels, Eigen::VectorXi &selected_mask) const |
| Get a mask for selecting parameters. More... | |
| void | getParameterVectorAll (Eigen::VectorXd &all_values) const |
| Return a vector that returns all available parameter values. More... | |
| int | getParameterVectorAllSize (void) const |
| Get the size of the parameter values vector when it contains all available parameter values. More... | |
| bool | saveGMM (std::string directory, bool overwrite=false) const |
| Save a Gaussian mixture model to a directory; useful for debugging. More... | |
| void | toMatrix (Eigen::MatrixXd &gmm_as_matrix) const |
| This function represents the Gaussian Mixture Model as one big matrix. More... | |
| bool | saveGMMToMatrix (std::string filename, bool overwrite=false) const |
| Save the GMM as a matrix in an ASCII file. More... | |
| UnifiedModel * | toUnifiedModel (void) const |
| Convert these model parameters to unified model parameters. More... | |
Public Member Functions inherited from ModelParameters | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
| Serialize class data members to boost archive. More... | |
Public Member Functions inherited from Parameterizable | |
| virtual | ~Parameterizable (void) |
| Destructor. | |
| virtual int | getParameterVectorSelectedSize (void) const |
| Get the size of the vector of selected parameters, as returned by getParameterVectorSelected(. More... | |
| virtual void | getParameterVectorSelected (Eigen::VectorXd &values, bool normalized=false) const |
| Get the values of the selected parameters in one vector. More... | |
| virtual void | getParameterVectorSelectedNormalized (Eigen::VectorXd &values) const |
| Get the normalized values of the selected parameters in one vector. More... | |
| void | getParameterVectorSelectedMinMax (Eigen::VectorXd &min, Eigen::VectorXd &max) const |
| Get the minimum and maximum of the selected parameters in one vector. More... | |
| void | getParameterVectorAllMinMax (Eigen::VectorXd &min, Eigen::VectorXd &max) const |
| Get the minimum and maximum values of the current parameter vector. More... | |
| void | getParameterVectorSelectedRanges (Eigen::VectorXd &ranges) const |
| Get the ranges of the selected parameters, i.e. More... | |
| virtual void | setParameterVectorSelected (const Eigen::VectorXd &values, bool normalized=false) |
| Set all the values of the selected parameters with one vector. More... | |
| virtual void | setParameterVectorSelectedNormalized (const Eigen::VectorXd &values) |
| Set all the values of the selected parameters with one vector of normalized values. More... | |
| virtual void | setSelectedParameters (const std::set< std::string > &selected_values_labels) |
| Determine which subset of parameters is represented in the vector returned by Parameterizable::getParameterVectorSelected. More... | |
| void | setSelectedParametersOne (std::string selected) |
| Set the parameters that are currently selected. More... | |
| void | setParameterVectorModifier (std::string modifier, bool new_value) |
| Turn certain modifiers on or off. More... | |
| void | setVectorLengthsPerDimension (const Eigen::VectorXi &lengths_per_dimension) |
| The vector (VectorXd) with parameter values can be split into different parts (as vector<VectorXd>; this function specifices the length of each sub-vector. More... | |
| Eigen::VectorXi | getVectorLengthsPerDimension (void) const |
| Get the specified length of each vector in each dimension. More... | |
| void | getParameterVectorSelected (std::vector< Eigen::VectorXd > &values, bool normalized=false) const |
| Get the values of the selected parameters in one vector. More... | |
| void | setParameterVectorSelected (const std::vector< Eigen::VectorXd > &values, bool normalized=false) |
| Set all the values of the selected parameters with a vector of vectors. More... | |
Static Public Member Functions | |
| static bool | saveGMM (std::string directory, const std::vector< Eigen::VectorXd > ¢ers, const std::vector< Eigen::MatrixXd > &covars, bool overwrite=false, int iter=-1) |
| Save a Gaussian mixture model to a directory; useful for debugging. More... | |
| static ModelParametersGMR * | fromMatrix (const Eigen::MatrixXd &gmm_matrix) |
| Initialize a GMM from a matrix. More... | |
| static ModelParametersGMR * | loadGMMFromMatrix (std::string filename) |
| Load the GMM from a matrix in an ASCII file. More... | |
Protected Member Functions | |
| void | setParameterVectorAll (const Eigen::VectorXd &values) |
| Set all available parameter values with one vector. More... | |
Friends | |
| class | FunctionApproximatorGMR |
| class | boost::serialization::access |
| Give boost serialization access to private members. More... | |
Model parameters for the GMR function approximator.
Definition at line 38 of file ModelParametersGMR.hpp.
|
inline |
Get the number of Gaussians in the GMM.
Definition at line 73 of file ModelParametersGMR.hpp.
|
inlinevirtual |
The expected dimensionality of the output data.
For now, we only consider 1-dimensional output by default.
Reimplemented from ModelParameters.
Definition at line 78 of file ModelParametersGMR.hpp.
|
inlinevirtual |
The expected dimensionality of the input data.
Implements ModelParameters.
Definition at line 84 of file ModelParametersGMR.hpp.

|
virtual |
Returns a string representation of the object.
Implements ModelParameters.
Definition at line 236 of file ModelParametersGMR.cpp.
|
virtual |
Return a pointer to a deep copy of the ModelParameters object.
Implements ModelParameters.
Definition at line 196 of file ModelParametersGMR.cpp.
|
virtual |
Return all the names of the parameter types that can be selected.
| [out] | selected_values_labels | Names of the parameter types that can be selected |
Implements Parameterizable.
Definition at line 403 of file ModelParametersGMR.cpp.
|
virtual |
Get a mask for selecting parameters.
| [in] | selected_values_labels | Labels of the selected parameter values |
| [out] | selected_mask | A mask indicating indices of selected parameters. 0 indicates not selected, >0 indicates selected. |
For instance, if the parameters consists of centers, widths and slopes the parameter values vector will be something like
centers widths slopes [ 100 110 120 10 10 10 0.4 0.7 0.4 ]
In this case, if selected_values_labels contains "centers" and "slopes", the mask will be:
centers widths slopes [ 1 1 1 0 0 0 3 3 3 ]
The '0' indicates that these parameters are not selected. The other ones have different numbers so that they may be discerned from one another (as required in Parameterizable::getParameterVectorSelectedMinMax for instance.
Implements Parameterizable.
Definition at line 413 of file ModelParametersGMR.cpp.
|
virtual |
Return a vector that returns all available parameter values.
| [out] | values | All available parameter values in one vector. |
Implements Parameterizable.
Definition at line 451 of file ModelParametersGMR.cpp.
|
inlinevirtual |
Get the size of the parameter values vector when it contains all available parameter values.
For instance, if the parameters consists of centers, widths and slopes the parameter values vector will be something like
centers widths slopes [ 100 110 120 10 10 10 0.4 0.7 0.4 ]
then getParameterVectorAllSize() will return 9
Implements Parameterizable.
Definition at line 102 of file ModelParametersGMR.hpp.

|
static |
Save a Gaussian mixture model to a directory; useful for debugging.
| [in] | directory | Directory to save to |
| [in] | centers | Centers of the Gaussians |
| [in] | covars | Covariance matrices of the Gaussians |
| [in] | overwrite | Whether to overwrite existing files or not. |
| [in] | iter | Iteration number when running Expectation-Maximization. Allows the GMM to be stored with a different filename (in the same directory) at each iteration. |
Definition at line 241 of file ModelParametersGMR.cpp.

| bool saveGMM | ( | std::string | directory, |
| bool | overwrite = false |
||
| ) | const |
Save a Gaussian mixture model to a directory; useful for debugging.
| [in] | directory | Directory to save to |
| [in] | overwrite | Whether to overwrite existing files or not. |
Definition at line 268 of file ModelParametersGMR.cpp.

| void toMatrix | ( | Eigen::MatrixXd & | gmm_as_matrix | ) | const |
This function represents the Gaussian Mixture Model as one big matrix.
| [out] | gmm_as_matrix | The Gaussian Mixture Model as one big matrix |
In combination with ModelParametersGMR::saveGMMToMatrix() and ModelParametersGMR::loadGMMFromMatrix(), this hacky function allowed for easier exchange with some Matlab code we wrote.
This matrix contains the following rows (example for two Gaussians, with dimensionality 3)
0. meta_data (n_gaussians and n_output_dims) 1. meta_data (n_observations) __________________________ 2. prior1 and E1 3. mean1 (size: 3) 4. covar1 (row1 of covar matrix) 5. covar1 (row2 of covar matrix) 6. covar1 (row3 of covar matrix) __________________________ 7. prior2 and E2 8. mean2 (size: 3) 9. covar2 (row1 of covar matrix) 10. covar2 (row2 of covar matrix) 11. covar2 (row3 of covar matrix)
Thus, the number of rows in the Matrix is 2 (for meta-data) + n_gaussians * (1+1+n_dims)
Definition at line 305 of file ModelParametersGMR.cpp.
|
static |
Initialize a GMM from a matrix.
| [in] | gmm_matrix | The GMM, represented as a matrix. |
Definition at line 348 of file ModelParametersGMR.cpp.
| bool saveGMMToMatrix | ( | std::string | filename, |
| bool | overwrite = false |
||
| ) | const |
Save the GMM as a matrix in an ASCII file.
| [in] | filename | The name of the file to save the GMM to. |
| [in] | overwrite | Whether to overwrite the file if it already exists. |
Definition at line 380 of file ModelParametersGMR.cpp.

|
static |
Load the GMM from a matrix in an ASCII file.
| [in] | filename | The name of the file to load the GMM from. |
Definition at line 394 of file ModelParametersGMR.cpp.

|
virtual |
Convert these model parameters to unified model parameters.
Implements ModelParameters.
Definition at line 548 of file ModelParametersGMR.cpp.
|
protectedvirtual |
Set all available parameter values with one vector.
| [in] | values | All available parameter values in one vector. |
Implements Parameterizable.
Definition at line 497 of file ModelParametersGMR.cpp.
|
friend |
Give boost serialization access to private members.
Definition at line 214 of file ModelParametersGMR.hpp.
1.8.11