iCub-main
Public Member Functions | List of all members
iCub::learningmachine::RLSLearner Class Reference

Recursive Regularized Least Squares (a.k.a. More...

#include <RLSLearner.h>

+ Inheritance diagram for iCub::learningmachine::RLSLearner:

Public Member Functions

 RLSLearner (unsigned int dom=1, unsigned int cod=1, double lambda=1.0)
 Constructor. More...
 
 RLSLearner (const RLSLearner &other)
 Copy constructor. More...
 
virtual ~RLSLearner ()
 Destructor. More...
 
RLSLearneroperator= (const RLSLearner &other)
 Assignment operator. More...
 
virtual void feedSample (const yarp::sig::Vector &input, const yarp::sig::Vector &output)
 Provide the learning machine with an example of the desired mapping. More...
 
virtual void train ()
 Train the learning machine on the examples that have been supplied so far. More...
 
virtual Prediction predict (const yarp::sig::Vector &input)
 Ask the learning machine to predict the output for a given input. More...
 
void reset ()
 Forget everything and start over. More...
 
RLSLearnerclone ()
 Asks the learning machine to return a clone of its type. More...
 
virtual std::string getInfo ()
 Asks the learning machine to return a string containing information on its operation so far. More...
 
virtual std::string getConfigHelp ()
 Asks the learning machine to return a string containing the list of configuration options that it supports. More...
 
virtual void writeBottle (yarp::os::Bottle &bot)
 
virtual void readBottle (yarp::os::Bottle &bot)
 Unserializes a machine from a bottle. More...
 
void setDomainSize (unsigned int size)
 Mutator for the domain size. More...
 
void setCoDomainSize (unsigned int size)
 Mutator for the codomain size. More...
 
void setLambda (double l)
 Sets the regularization parameter \lambda to a specified value. More...
 
double getLambda ()
 Accessor for the regularization parameter \lambda. More...
 
virtual bool configure (yarp::os::Searchable &config)
 Change parameters. More...
 
- Public Member Functions inherited from iCub::learningmachine::IFixedSizeLearner
 IFixedSizeLearner (unsigned int dom=1, unsigned int cod=1)
 Constructor. More...
 
unsigned int getDomainSize () const
 Returns the size (dimensionality) of the input domain. More...
 
unsigned int getCoDomainSize () const
 Returns the size (dimensionality) of the output domain (codomain). More...
 
- Public Member Functions inherited from iCub::learningmachine::IMachineLearner
 IMachineLearner ()
 Constructor. More...
 
virtual ~IMachineLearner ()
 Destructor (empty). More...
 
virtual bool open (yarp::os::Searchable &config)
 Initialize the object. More...
 
virtual bool close ()
 Shut the object down. More...
 
bool write (yarp::os::ConnectionWriter &connection) const
 
bool read (yarp::os::ConnectionReader &connection)
 
virtual std::string toString ()
 Asks the learning machine to return a string serialization. More...
 
virtual bool fromString (const std::string &str)
 Asks the learning machine to initialize from a string serialization. More...
 
std::string getName () const
 Retrieve the name of this machine learning technique. More...
 
void setName (const std::string &name)
 Set the name of this machine learning technique. More...
 

Additional Inherited Members

- Protected Member Functions inherited from iCub::learningmachine::IFixedSizeLearner
virtual bool checkDomainSize (const yarp::sig::Vector &input)
 Checks whether the input is of the desired dimensionality. More...
 
virtual bool checkCoDomainSize (const yarp::sig::Vector &output)
 Checks whether the output is of the desired dimensionality. More...
 
void validateDomainSizes (const yarp::sig::Vector &input, const yarp::sig::Vector &output)
 Validates whether the input and output are of the desired dimensionality. More...
 
virtual void writeBottle (yarp::os::Bottle &bot) const
 Writes a serialization of the machine into a bottle. More...
 
- Protected Attributes inherited from iCub::learningmachine::IFixedSizeLearner
unsigned int domainSize
 The dimensionality of the input domain. More...
 
unsigned int coDomainSize
 The dimensionality of the output domain (codomain). More...
 
- Protected Attributes inherited from iCub::learningmachine::IMachineLearner
std::string name
 The name of this type of machine learner. More...
 

Detailed Description

Recursive Regularized Least Squares (a.k.a.

ridge regression) learner. It uses a rank 1 update rule to update the Cholesky factor of the covariance matrix.

See also
iCub::learningmachine::IMachineLearner
iCub::learningmachine::IFixedSizeLearner
iCub::learningmachine::LinearGPRLearner
Author
Arjan Gijsberts

Definition at line 46 of file RLSLearner.h.

Constructor & Destructor Documentation

◆ RLSLearner() [1/2]

iCub::learningmachine::RLSLearner::RLSLearner ( unsigned int  dom = 1,
unsigned int  cod = 1,
double  lambda = 1.0 
)

Constructor.

Parameters
dominitial domain size
codinitial codomain size
lambdainitial value for regularization parameter \lambda

Definition at line 37 of file RLSLearner.cpp.

◆ RLSLearner() [2/2]

iCub::learningmachine::RLSLearner::RLSLearner ( const RLSLearner other)

Copy constructor.

Definition at line 48 of file RLSLearner.cpp.

◆ ~RLSLearner()

iCub::learningmachine::RLSLearner::~RLSLearner ( )
virtual

Destructor.

Definition at line 53 of file RLSLearner.cpp.

Member Function Documentation

◆ clone()

RLSLearner* iCub::learningmachine::RLSLearner::clone ( )
inlinevirtual

Asks the learning machine to return a clone of its type.

Returns
a clone of the current learner

Implements iCub::learningmachine::IMachineLearner.

Definition at line 121 of file RLSLearner.h.

◆ configure()

bool iCub::learningmachine::RLSLearner::configure ( yarp::os::Searchable &  config)
virtual

Change parameters.

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 160 of file RLSLearner.cpp.

◆ feedSample()

void iCub::learningmachine::RLSLearner::feedSample ( const yarp::sig::Vector &  input,
const yarp::sig::Vector &  output 
)
virtual

Provide the learning machine with an example of the desired mapping.

Parameters
inputa sample input
outputthe corresponding output

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 70 of file RLSLearner.cpp.

◆ getConfigHelp()

std::string iCub::learningmachine::RLSLearner::getConfigHelp ( )
virtual

Asks the learning machine to return a string containing the list of configuration options that it supports.

Returns
an informative description of the configuration options

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 117 of file RLSLearner.cpp.

◆ getInfo()

std::string iCub::learningmachine::RLSLearner::getInfo ( )
virtual

Asks the learning machine to return a string containing information on its operation so far.

Returns
the information on the machine

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 104 of file RLSLearner.cpp.

◆ getLambda()

double iCub::learningmachine::RLSLearner::getLambda ( )

Accessor for the regularization parameter \lambda.

Returns
the value of the parameter

Definition at line 155 of file RLSLearner.cpp.

◆ operator=()

RLSLearner & iCub::learningmachine::RLSLearner::operator= ( const RLSLearner other)

Assignment operator.

Definition at line 56 of file RLSLearner.cpp.

◆ predict()

Prediction iCub::learningmachine::RLSLearner::predict ( const yarp::sig::Vector &  input)
virtual

Ask the learning machine to predict the output for a given input.

Parameters
inputthe input
Returns
the expected output

Implements iCub::learningmachine::IMachineLearner.

Definition at line 89 of file RLSLearner.cpp.

◆ readBottle()

void iCub::learningmachine::RLSLearner::readBottle ( yarp::os::Bottle &  bot)
virtual

Unserializes a machine from a bottle.

This method is internally referenced by the read method. Typically, subclasses should override this method instead of overriding the read method directly.

Parameters
botthe bottle

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 130 of file RLSLearner.cpp.

◆ reset()

void iCub::learningmachine::RLSLearner::reset ( )
virtual

Forget everything and start over.

Implements iCub::learningmachine::IMachineLearner.

Definition at line 97 of file RLSLearner.cpp.

◆ setCoDomainSize()

void iCub::learningmachine::RLSLearner::setCoDomainSize ( unsigned int  size)
virtual

Mutator for the codomain size.

Parameters
sizethe desired codomain size

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 141 of file RLSLearner.cpp.

◆ setDomainSize()

void iCub::learningmachine::RLSLearner::setDomainSize ( unsigned int  size)
virtual

Mutator for the domain size.

Parameters
sizethe desired domain size

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 136 of file RLSLearner.cpp.

◆ setLambda()

void iCub::learningmachine::RLSLearner::setLambda ( double  l)

Sets the regularization parameter \lambda to a specified value.

This resets the machine.

Parameters
lthe desired value.

Definition at line 146 of file RLSLearner.cpp.

◆ train()

void iCub::learningmachine::RLSLearner::train ( )
virtual

Train the learning machine on the examples that have been supplied so far.

This method is primarily intended to be used for offline/batch learning machines. It explicitly initiates the training routine on those machines for the samples that have been collected so far.

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 85 of file RLSLearner.cpp.

◆ writeBottle()

void iCub::learningmachine::RLSLearner::writeBottle ( yarp::os::Bottle &  bot)
virtual

Definition at line 124 of file RLSLearner.cpp.


The documentation for this class was generated from the following files: