iCub-main
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iCub::learningmachine::LinearGPRLearner Class Reference

Standard linear Bayesian regression or, equivalently, Gaussian Process Regression with a linear covariance function. More...

#include <LinearGPRLearner.h>

+ Inheritance diagram for iCub::learningmachine::LinearGPRLearner:

Public Member Functions

 LinearGPRLearner (unsigned int dom=1, unsigned int cod=1, double sigma=1.0)
 Constructor.
 
 LinearGPRLearner (const LinearGPRLearner &other)
 Copy constructor.
 
virtual ~LinearGPRLearner ()
 Destructor.
 
LinearGPRLearneroperator= (const LinearGPRLearner &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.
 
LinearGPRLearnerclone ()
 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 setSigma (double s)
 Sets the signal noise \sigma to a specified value.
 
double getSigma ()
 Accessor for the signal noise \sigma.
 
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.
 

Detailed Description

Standard linear Bayesian regression or, equivalently, Gaussian Process Regression with a linear covariance function.

It uses a rank 1 update rule to incrementally update the Cholesky factor of the covariance matrix.

See: Gaussian Processes for Machine Learning. Carl Edward Rasmussen and Christopher K. I. Williams. The MIT Press, 2005.

Pattern Recognition and Machine Learning. Christopher M. Bishop. Springer-Verlag, 2006.

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

Definition at line 59 of file LinearGPRLearner.h.

Constructor & Destructor Documentation

◆ LinearGPRLearner() [1/2]

iCub::learningmachine::LinearGPRLearner::LinearGPRLearner ( unsigned int  dom = 1,
unsigned int  cod = 1,
double  sigma = 1.0 
)

Constructor.

Parameters
dominitial domain size
codinitial codomain size
sigmainitial value for signal noise \sigma

Definition at line 41 of file LinearGPRLearner.cpp.

◆ LinearGPRLearner() [2/2]

iCub::learningmachine::LinearGPRLearner::LinearGPRLearner ( const LinearGPRLearner other)

Copy constructor.

Definition at line 52 of file LinearGPRLearner.cpp.

◆ ~LinearGPRLearner()

iCub::learningmachine::LinearGPRLearner::~LinearGPRLearner ( )
virtual

Destructor.

Definition at line 57 of file LinearGPRLearner.cpp.

Member Function Documentation

◆ clone()

LinearGPRLearner * iCub::learningmachine::LinearGPRLearner::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 134 of file LinearGPRLearner.h.

◆ configure()

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

Change parameters.

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 170 of file LinearGPRLearner.cpp.

◆ feedSample()

void iCub::learningmachine::LinearGPRLearner::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 74 of file LinearGPRLearner.cpp.

◆ getConfigHelp()

std::string iCub::learningmachine::LinearGPRLearner::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 127 of file LinearGPRLearner.cpp.

◆ getInfo()

std::string iCub::learningmachine::LinearGPRLearner::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 114 of file LinearGPRLearner.cpp.

◆ getSigma()

double iCub::learningmachine::LinearGPRLearner::getSigma ( )

Accessor for the signal noise \sigma.

Returns
the value of the parameter

Definition at line 165 of file LinearGPRLearner.cpp.

◆ operator=()

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

Assignment operator.

Definition at line 60 of file LinearGPRLearner.cpp.

◆ predict()

Prediction iCub::learningmachine::LinearGPRLearner::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 93 of file LinearGPRLearner.cpp.

◆ readBottle()

void iCub::learningmachine::LinearGPRLearner::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 140 of file LinearGPRLearner.cpp.

◆ reset()

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

Forget everything and start over.

Implements iCub::learningmachine::IMachineLearner.

Definition at line 107 of file LinearGPRLearner.cpp.

◆ setCoDomainSize()

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

Mutator for the codomain size.

Parameters
sizethe desired codomain size

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 151 of file LinearGPRLearner.cpp.

◆ setDomainSize()

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

Mutator for the domain size.

Parameters
sizethe desired domain size

Reimplemented from iCub::learningmachine::IFixedSizeLearner.

Definition at line 146 of file LinearGPRLearner.cpp.

◆ setSigma()

void iCub::learningmachine::LinearGPRLearner::setSigma ( double  s)

Sets the signal noise \sigma to a specified value.

This resets the machine.

Parameters
sthe desired value.

Definition at line 156 of file LinearGPRLearner.cpp.

◆ train()

void iCub::learningmachine::LinearGPRLearner::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 89 of file LinearGPRLearner.cpp.

◆ writeBottle()

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

Definition at line 134 of file LinearGPRLearner.cpp.


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