iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::learningmachine::IMachineLearner Class Referenceabstract

A generalized interface for a learning machine for offline and online learning machines (e.g. More...

#include <IMachineLearner.h>

+ Inheritance diagram for iCub::learningmachine::IMachineLearner:

Public Member Functions

 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...
 
virtual bool configure (yarp::os::Searchable &config)
 Change parameters. More...
 
virtual void feedSample (const yarp::sig::Vector &input, const yarp::sig::Vector &output)=0
 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)=0
 Ask the learning machine to predict the output for a given input. More...
 
virtual IMachineLearnerclone ()=0
 Asks the learning machine to return a clone of its type. More...
 
virtual void reset ()=0
 Forget everything and start over. More...
 
bool write (yarp::os::ConnectionWriter &connection) const
 
bool read (yarp::os::ConnectionReader &connection)
 
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 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...
 

Protected Member Functions

virtual void writeBottle (yarp::os::Bottle &bot) const =0
 Writes a serialization of the machine into a bottle. More...
 
virtual void readBottle (yarp::os::Bottle &bot)=0
 Unserializes a machine from a bottle. More...
 

Protected Attributes

std::string name
 The name of this type of machine learner. More...
 

Detailed Description

A generalized interface for a learning machine for offline and online learning machines (e.g.

SVM, LSSVM, ANN). This interface extends the Learner interface, which imposes certain limitations. Learning machines that meet this interface can, if desired, be made into two executable modules by iCub::contrib::LearnModule and iCub::contrib::PredictModule.

The learning machine can be used for regression and classification from R^* to R^*.

Be aware that objects of this class type cannot be written directly on a port, although this interface implements Portable. The reason is that this is an abstract base class, which conflicts with the template port readers and writers. See MachinePortable for how to send Learning Machines over ports.

See also
iCub::contrib::Learner
iCub::contrib::IFixedSizeLearner
iCub::contrib::MachinePortable
iCub::contrib::MachineFactory
Author
Arjan Gijsberts

Definition at line 88 of file IMachineLearner.h.

Constructor & Destructor Documentation

◆ IMachineLearner()

iCub::learningmachine::IMachineLearner::IMachineLearner ( )
inline

Constructor.

Definition at line 117 of file IMachineLearner.h.

◆ ~IMachineLearner()

virtual iCub::learningmachine::IMachineLearner::~IMachineLearner ( )
inlinevirtual

Destructor (empty).

Definition at line 122 of file IMachineLearner.h.

Member Function Documentation

◆ clone()

virtual IMachineLearner* iCub::learningmachine::IMachineLearner::clone ( )
pure virtual

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

Returns
a clone of the current learner

Implemented in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.

◆ close()

virtual bool iCub::learningmachine::IMachineLearner::close ( void  )
inlinevirtual

Shut the object down.

Definition at line 133 of file IMachineLearner.h.

◆ configure()

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

◆ feedSample()

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

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

Parameters
inputa sample input
outputthe corresponding output

Implemented in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.

◆ fromString()

virtual bool iCub::learningmachine::IMachineLearner::fromString ( const std::string &  str)
inlinevirtual

Asks the learning machine to initialize from a string serialization.

Returns
true on succes

Definition at line 232 of file IMachineLearner.h.

◆ getConfigHelp()

virtual std::string iCub::learningmachine::IMachineLearner::getConfigHelp ( )
inlinevirtual

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 in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, and iCub::learningmachine::DatasetRecorder.

Definition at line 211 of file IMachineLearner.h.

◆ getInfo()

virtual std::string iCub::learningmachine::IMachineLearner::getInfo ( )
inlinevirtual

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

Returns
the information on the machine

Reimplemented in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.

Definition at line 201 of file IMachineLearner.h.

◆ getName()

std::string iCub::learningmachine::IMachineLearner::getName ( ) const
inline

Retrieve the name of this machine learning technique.

Returns
the name of this machine learner

Definition at line 243 of file IMachineLearner.h.

◆ open()

virtual bool iCub::learningmachine::IMachineLearner::open ( yarp::os::Searchable &  config)
inlinevirtual

Initialize the object.

Definition at line 128 of file IMachineLearner.h.

◆ predict()

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

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

Parameters
inputthe input
Returns
the expected output

Implemented in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.

◆ read()

bool iCub::learningmachine::IMachineLearner::read ( yarp::os::ConnectionReader &  connection)
inline

Definition at line 188 of file IMachineLearner.h.

◆ readBottle()

virtual void iCub::learningmachine::IMachineLearner::readBottle ( yarp::os::Bottle &  bot)
protectedpure 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

Implemented in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.

◆ reset()

virtual void iCub::learningmachine::IMachineLearner::reset ( )
pure virtual

◆ setName()

void iCub::learningmachine::IMachineLearner::setName ( const std::string &  name)
inline

Set the name of this machine learning technique.

Parameters
namethe new name

Definition at line 252 of file IMachineLearner.h.

◆ toString()

virtual std::string iCub::learningmachine::IMachineLearner::toString ( )
inlinevirtual

Asks the learning machine to return a string serialization.

Returns
a string serialization of the machine

Definition at line 221 of file IMachineLearner.h.

◆ train()

virtual void iCub::learningmachine::IMachineLearner::train ( )
inlinevirtual

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 in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.

Definition at line 154 of file IMachineLearner.h.

◆ write()

bool iCub::learningmachine::IMachineLearner::write ( yarp::os::ConnectionWriter &  connection) const
inline

Definition at line 179 of file IMachineLearner.h.

◆ writeBottle()

virtual void iCub::learningmachine::IMachineLearner::writeBottle ( yarp::os::Bottle &  bot) const
protectedpure virtual

Writes a serialization of the machine into a bottle.

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

Parameters
botthe bottle containing the machine serialization

Implemented in iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.

Member Data Documentation

◆ name

std::string iCub::learningmachine::IMachineLearner::name
protected

The name of this type of machine learner.

Definition at line 93 of file IMachineLearner.h.


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