|
DMP_BBO library
|
Model parameters for the Locally Weighted Regression (LWR) function approximator. More...
#include <ModelParametersLWR.hpp>


Public Member Functions | |
| ModelParametersLWR (const Eigen::MatrixXd ¢ers, const Eigen::MatrixXd &widths, const Eigen::MatrixXd &slopes, const Eigen::MatrixXd &offsets, bool asymmetric_kernels=false, bool lines_pivot_at_max_activation=false) | |
| Constructor for the model parameters of the LWPR function approximator. 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... | |
| int | getExpectedInputDim (void) const |
| The expected dimensionality of the input data. More... | |
| void | unnormalizedKernelActivations (const Eigen::Ref< const Eigen::MatrixXd > &inputs, Eigen::MatrixXd &kernel_activations) const |
| Get the unnormalized kernel activations for given inputs. More... | |
| void | kernelActivations (const Eigen::Ref< const Eigen::MatrixXd > &inputs, Eigen::MatrixXd &kernel_activations) const |
| Get the normalized kernel activations for given inputs. More... | |
| void | getLines (const Eigen::Ref< const Eigen::MatrixXd > &inputs, Eigen::MatrixXd &lines) const |
| Get the output of each linear model (unweighted) for the given inputs. More... | |
| void | setParameterVectorModifierPrivate (std::string modifier, bool new_value) |
| Turn certain modifiers on or off, see Parameterizable::setParameterVectorModifier(). More... | |
| void | set_lines_pivot_at_max_activation (bool lines_pivot_at_max_activation) |
| Set whether the offsets should be adapted so that the line segments pivot around the mode of the basis function, rather than the intersection with the y-axis. More... | |
| void | set_slopes_as_angles (bool slopes_as_angles) |
| Whether to return slopes as angles or slopes in ModelParametersLWR::getParameterVectorAll() 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... | |
| unsigned int | getNumberOfBasisFunctions () const |
| Get the number of basis functions in this model. More... | |
| UnifiedModel * | toUnifiedModel (void) const |
| Convert these model parameters to unified model parameters. More... | |
| void | set_caching (bool caching) |
| Turn caching for the function normalizedKernelActivations() on or off. More... | |
Public Member Functions inherited from ModelParameters | |
| virtual int | getExpectedOutputDim (void) const |
| The expected dimensionality of the output data. More... | |
| 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... | |
Protected Member Functions | |
| void | setParameterVectorAll (const Eigen::VectorXd &values) |
| Set all available parameter values with one vector. More... | |
Friends | |
| class | FunctionApproximatorLWR |
| class | boost::serialization::access |
| Give boost serialization access to private members. More... | |
Model parameters for the Locally Weighted Regression (LWR) function approximator.
Definition at line 40 of file ModelParametersLWR.hpp.
| ModelParametersLWR | ( | const Eigen::MatrixXd & | centers, |
| const Eigen::MatrixXd & | widths, | ||
| const Eigen::MatrixXd & | slopes, | ||
| const Eigen::MatrixXd & | offsets, | ||
| bool | asymmetric_kernels = false, |
||
| bool | lines_pivot_at_max_activation = false |
||
| ) |
Constructor for the model parameters of the LWPR function approximator.
| [in] | centers | Centers of the basis functions |
| [in] | widths | Widths of the basis functions. |
| [in] | slopes | Slopes of the line segments. |
| [in] | offsets | Offsets of the line segments, i.e. the value of the line segment at its intersection with the y-axis. |
| [in] | asymmetric_kernels | Whether to use asymmetric kernels or not, cf MetaParametersLWR::asymmetric_kernels() |
| [in] | lines_pivot_at_max_activation | Whether line models should pivot at x=0 (false), or at the center of the kernel (x=x_c) |
Definition at line 54 of file ModelParametersLWR.cpp.
|
virtual |
Returns a string representation of the object.
Implements ModelParameters.
Definition at line 308 of file ModelParametersLWR.cpp.
|
virtual |
Return a pointer to a deep copy of the ModelParameters object.
Implements ModelParameters.
Definition at line 84 of file ModelParametersLWR.cpp.
|
inlinevirtual |
The expected dimensionality of the input data.
Implements ModelParameters.
Definition at line 59 of file ModelParametersLWR.hpp.

| void unnormalizedKernelActivations | ( | const Eigen::Ref< const Eigen::MatrixXd > & | inputs, |
| Eigen::MatrixXd & | kernel_activations | ||
| ) | const |
Get the unnormalized kernel activations for given inputs.
| [in] | inputs | The input data (size: n_samples X n_dims) |
| [out] | kernel_activations | The kernel activations, computed for each of the samples in the input data (size: n_samples X n_basis_functions) |
Definition at line 88 of file ModelParametersLWR.cpp.
| void kernelActivations | ( | const Eigen::Ref< const Eigen::MatrixXd > & | inputs, |
| Eigen::MatrixXd & | kernel_activations | ||
| ) | const |
Get the normalized kernel activations for given inputs.
| [in] | inputs | The input data (size: n_samples X n_dims) |
| [out] | kernel_activations | The normalized kernel activations, computed for each of the sampels in the input data (size: n_samples X n_basis_functions) |
Definition at line 97 of file ModelParametersLWR.cpp.
| void getLines | ( | const Eigen::Ref< const Eigen::MatrixXd > & | inputs, |
| Eigen::MatrixXd & | lines | ||
| ) | const |
Get the output of each linear model (unweighted) for the given inputs.
| [in] | inputs | The inputs for which to compute the output of the lines models (size: n_samples X n_input_dims) |
| [out] | lines | The output of the linear models (size: n_samples X n_basis_functions) |
If "lines" is passed as a Matrix of correct size (n_samples X n_basis_functions), this function will not allocate any memory, and is real-time.
Definition at line 216 of file ModelParametersLWR.cpp.
|
virtual |
Turn certain modifiers on or off, see Parameterizable::setParameterVectorModifier().
Parameterizable::setParameterVectorModifierPrivate(), This function may (but must not be) overridden by subclasses of Parameterizable, depending on whether the subclass has modifiers (or not)
| [in] | modifier | The name of the modifier |
| [in] | new_value | Whether to turn the modifier on (true) or off (false) |
Reimplemented from Parameterizable.
Definition at line 445 of file ModelParametersLWR.cpp.

| void set_lines_pivot_at_max_activation | ( | bool | lines_pivot_at_max_activation | ) |
Set whether the offsets should be adapted so that the line segments pivot around the mode of the basis function, rather than the intersection with the y-axis.
| [in] | lines_pivot_at_max_activation | Whether to pivot around the mode or not. |
Definition at line 132 of file ModelParametersLWR.cpp.
| void set_slopes_as_angles | ( | bool | slopes_as_angles | ) |
Whether to return slopes as angles or slopes in ModelParametersLWR::getParameterVectorAll()
| [in] | slopes_as_angles | Whether to return as slopes (true) or angles (false) |
Definition at line 176 of file ModelParametersLWR.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 313 of file ModelParametersLWR.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 323 of file ModelParametersLWR.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 359 of file ModelParametersLWR.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 ModelParametersLWR.hpp.
|
inline |
Get the number of basis functions in this model.
Definition at line 110 of file ModelParametersLWR.hpp.

|
virtual |
Convert these model parameters to unified model parameters.
Implements ModelParameters.
Definition at line 455 of file ModelParametersLWR.cpp.
|
protectedvirtual |
Set all available parameter values with one vector.
| [in] | values | All available parameter values in one vector. |
Implements Parameterizable.
Definition at line 398 of file ModelParametersLWR.cpp.

|
inline |
Turn caching for the function normalizedKernelActivations() on or off.
Turning this on should lead to substantial improvements in execution time if the centers and widths of the kernels do not change often AND you call normalizedKernelActivations with the same inputs over and over again.
| [in] | caching | Whether to turn caching on or off |
Definition at line 139 of file ModelParametersLWR.hpp.
|
friend |
Give boost serialization access to private members.
Definition at line 162 of file ModelParametersLWR.hpp.
1.8.11