24 #ifndef MODELPARAMETERSRRRFF_H 25 #define MODELPARAMETERSRRRFF_H 47 ModelParametersRRRFF(Eigen::VectorXd linear_models, Eigen::MatrixXd cosines_periodes, Eigen::VectorXd cosines_phase);
56 void getParameterVectorMask(
const std::set<std::string> selected_values_labels, Eigen::VectorXi& selected_mask)
const;
61 return all_values_vector_size_;
69 const Eigen::VectorXd&
weights(
void)
const {
return weights_; }
76 void cosineActivations(
const Eigen::Ref<const Eigen::MatrixXd>& inputs, Eigen::MatrixXd& cosine_activations)
const;
83 Eigen::VectorXd weights_;
84 Eigen::MatrixXd cosines_periodes_;
85 Eigen::VectorXd cosines_phase_;
89 int all_values_vector_size_;
102 if (!caching_) clearCache();
107 mutable Eigen::MatrixXd inputs_cached_;
108 mutable Eigen::MatrixXd cosine_activations_cached_;
110 inline void clearCache(
void)
112 inputs_cached_.resize(0,0);
113 cosine_activations_cached_.resize(0,0);
132 template<
class Archive>
133 void serialize(Archive & ar,
const unsigned int version);
139 #include <boost/serialization/export.hpp> 146 #endif // #ifndef MODELPARAMETERSRRRFF_H void getSelectableParameters(std::set< std::string > &selected_values_labels) const
Return all the names of the parameter types that can be selected.
std::string toString(void) const
Returns a string representation of the object.
void getParameterVectorMask(const std::set< std::string > selected_values_labels, Eigen::VectorXi &selected_mask) const
Get a mask for selecting parameters.
friend class boost::serialization::access
Give boost serialization access to private members.
ModelParameters * clone(void) const
Return a pointer to a deep copy of the ModelParameters object.
const Eigen::VectorXd & weights(void) const
Return the weights of the basis functions.
int getExpectedInputDim(void) const
The expected dimensionality of the input data.
BOOST_CLASS_EXPORT_KEY2(DmpBbo::TimeSystem,"TimeSystem")
Register this derived class.
BOOST_CLASS_IMPLEMENTATION(DmpBbo::ModelParametersRRRFF, boost::serialization::object_serializable)
Register this derived class.
UnifiedModel * toUnifiedModel(void) const
Convert these model parameters to unified model parameters.
The unified model, which can be used to represent the model of all other function approximators...
RRRFF (Ridge Regression with Random Fourier Features) function approximatorhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC3935121/.
ModelParameters class header file.
Base class for all model parameters of function approximators.
void setParameterVectorAll(const Eigen::VectorXd &values)
Set all available parameter values with one vector.
Model parameters for the RRRFF function approximator.
void getParameterVectorAll(Eigen::VectorXd &all_values) const
Return a vector that returns all available parameter values.
void set_caching(bool caching)
Turn caching for the function cosineActivations() on or off.
int getParameterVectorAllSize(void) const
Get the size of the parameter values vector when it contains all available parameter values...
void cosineActivations(const Eigen::Ref< const Eigen::MatrixXd > &inputs, Eigen::MatrixXd &cosine_activations) const
Get the values of the cosine basis functions for given inputs.