23#include <yarp/math/Math.h>
24#include <yarp/math/Rand.h>
30#define TWOPI 6.2831853071795862
32using namespace yarp::math;
37namespace learningmachine {
73 yarp::math::RandnScalar prng_normal;
74 yarp::math::RandScalar prng_uniform;
92 bot >>
W >> this->
b >> this->
gamma;
98 std::ostringstream buffer;
100 buffer <<
" gamma: " << this->
gamma;
105 std::ostringstream buffer;
107 buffer <<
" gamma val Set gamma parameter" << std::endl;
115 if(config.find(
"gamma").isFloat64() || config.find(
"gamma").isInt32()) {
116 this->
setGamma(config.find(
"gamma").asFloat64());
RandomFeature(unsigned int dom=1, unsigned int cod=1, double gamma=1.)
Constructor.
double gamma
Gamma parameter, analoguous to same parameter in RBF kernel.
virtual void readBottle(yarp::os::Bottle &bot)
Unserializes a transformer from a bottle.
virtual bool configure(yarp::os::Searchable &config)
virtual std::string getConfigHelp()
Asks the transformer to return a string containing the list of configuration options that it supports...
yarp::sig::Matrix W
Projection matrix W.
virtual yarp::sig::Vector transform(const yarp::sig::Vector &input)
Transforms an input vector.
yarp::sig::Vector b
Bias vector b.
virtual void reset()
Forget everything and start over.
virtual void setCoDomainSize(unsigned int size)
Mutator for the codomain size.
virtual void setDomainSize(unsigned int size)
Mutator for the domain size.
virtual std::string getInfo()
Asks the transformer to return a string containing statistics on its operation so far.
virtual void setGamma(double g)
Mutator for the gamma parameter.
virtual void writeBottle(yarp::os::Bottle &bot) const
Writes a serialization of the transformer into a bottle.
virtual double getGamma() const
Accessor for the gamma parameter.
yarp::sig::Vector & cosvec(yarp::sig::Vector &v)
Computes the cosine of a vector element-wise inplace.
yarp::sig::Vector random(int length, yarp::math::RandScalar &prng)
Returns a random vector with given dimensionality.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.