iCub-main
|
Recursive Regularized Least Squares (a.k.a. More...
#include <RLSLearner.h>
Public Member Functions | |
RLSLearner (unsigned int dom=1, unsigned int cod=1, double lambda=1.0) | |
Constructor. | |
RLSLearner (const RLSLearner &other) | |
Copy constructor. | |
virtual | ~RLSLearner () |
Destructor. | |
RLSLearner & | operator= (const RLSLearner &other) |
Assignment operator. | |
virtual void | feedSample (const yarp::sig::Vector &input, const yarp::sig::Vector &output) |
Provide the learning machine with an example of the desired mapping. | |
virtual void | train () |
Train the learning machine on the examples that have been supplied so far. | |
virtual Prediction | predict (const yarp::sig::Vector &input) |
Ask the learning machine to predict the output for a given input. | |
void | reset () |
Forget everything and start over. | |
RLSLearner * | clone () |
Asks the learning machine to return a clone of its type. | |
virtual std::string | getInfo () |
Asks the learning machine to return a string containing information on its operation so far. | |
virtual std::string | getConfigHelp () |
Asks the learning machine to return a string containing the list of configuration options that it supports. | |
virtual void | writeBottle (yarp::os::Bottle &bot) |
virtual void | readBottle (yarp::os::Bottle &bot) |
Unserializes a machine from a bottle. | |
void | setDomainSize (unsigned int size) |
Mutator for the domain size. | |
void | setCoDomainSize (unsigned int size) |
Mutator for the codomain size. | |
void | setLambda (double l) |
Sets the regularization parameter \lambda to a specified value. | |
double | getLambda () |
Accessor for the regularization parameter \lambda. | |
virtual bool | configure (yarp::os::Searchable &config) |
Change parameters. | |
Public Member Functions inherited from iCub::learningmachine::IFixedSizeLearner | |
IFixedSizeLearner (unsigned int dom=1, unsigned int cod=1) | |
Constructor. | |
unsigned int | getDomainSize () const |
Returns the size (dimensionality) of the input domain. | |
unsigned int | getCoDomainSize () const |
Returns the size (dimensionality) of the output domain (codomain). | |
Public Member Functions inherited from iCub::learningmachine::IMachineLearner | |
IMachineLearner () | |
Constructor. | |
virtual | ~IMachineLearner () |
Destructor (empty). | |
virtual bool | open (yarp::os::Searchable &config) |
Initialize the object. | |
virtual bool | close () |
Shut the object down. | |
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. | |
virtual bool | fromString (const std::string &str) |
Asks the learning machine to initialize from a string serialization. | |
std::string | getName () const |
Retrieve the name of this machine learning technique. | |
void | setName (const std::string &name) |
Set the name of this machine learning technique. | |
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. | |
virtual bool | checkCoDomainSize (const yarp::sig::Vector &output) |
Checks whether the output is of the desired dimensionality. | |
void | validateDomainSizes (const yarp::sig::Vector &input, const yarp::sig::Vector &output) |
Validates whether the input and output are of the desired dimensionality. | |
virtual void | writeBottle (yarp::os::Bottle &bot) const |
Writes a serialization of the machine into a bottle. | |
Protected Attributes inherited from iCub::learningmachine::IFixedSizeLearner | |
unsigned int | domainSize |
The dimensionality of the input domain. | |
unsigned int | coDomainSize |
The dimensionality of the output domain (codomain). | |
Protected Attributes inherited from iCub::learningmachine::IMachineLearner | |
std::string | name |
The name of this type of machine learner. | |
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.
Definition at line 46 of file RLSLearner.h.
iCub::learningmachine::RLSLearner::RLSLearner | ( | unsigned int | dom = 1 , |
unsigned int | cod = 1 , |
||
double | lambda = 1.0 |
||
) |
Constructor.
dom | initial domain size |
cod | initial codomain size |
lambda | initial value for regularization parameter \lambda |
Definition at line 37 of file RLSLearner.cpp.
iCub::learningmachine::RLSLearner::RLSLearner | ( | const RLSLearner & | other | ) |
Copy constructor.
Definition at line 48 of file RLSLearner.cpp.
|
virtual |
Destructor.
Definition at line 53 of file RLSLearner.cpp.
|
inlinevirtual |
Asks the learning machine to return a clone of its type.
Implements iCub::learningmachine::IMachineLearner.
Definition at line 121 of file RLSLearner.h.
|
virtual |
Change parameters.
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 160 of file RLSLearner.cpp.
|
virtual |
Provide the learning machine with an example of the desired mapping.
input | a sample input |
output | the corresponding output |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 70 of file RLSLearner.cpp.
|
virtual |
Asks the learning machine to return a string containing the list of configuration options that it supports.
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 117 of file RLSLearner.cpp.
|
virtual |
Asks the learning machine to return a string containing information on its operation so far.
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 104 of file RLSLearner.cpp.
double iCub::learningmachine::RLSLearner::getLambda | ( | ) |
Accessor for the regularization parameter \lambda.
Definition at line 155 of file RLSLearner.cpp.
RLSLearner & iCub::learningmachine::RLSLearner::operator= | ( | const RLSLearner & | other | ) |
Assignment operator.
Definition at line 56 of file RLSLearner.cpp.
|
virtual |
Ask the learning machine to predict the output for a given input.
input | the input |
Implements iCub::learningmachine::IMachineLearner.
Definition at line 89 of file RLSLearner.cpp.
|
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.
bot | the bottle |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 130 of file RLSLearner.cpp.
|
virtual |
Forget everything and start over.
Implements iCub::learningmachine::IMachineLearner.
Definition at line 97 of file RLSLearner.cpp.
|
virtual |
Mutator for the codomain size.
size | the desired codomain size |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 141 of file RLSLearner.cpp.
|
virtual |
Mutator for the domain size.
size | the desired domain size |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 136 of file RLSLearner.cpp.
void iCub::learningmachine::RLSLearner::setLambda | ( | double | l | ) |
Sets the regularization parameter \lambda to a specified value.
This resets the machine.
l | the desired value. |
Definition at line 146 of file RLSLearner.cpp.
|
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.
|
virtual |
Definition at line 124 of file RLSLearner.cpp.