iCub-main
Loading...
Searching...
No Matches
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.
 
virtual ~IMachineLearner ()
 Destructor (empty).
 
virtual bool open (yarp::os::Searchable &config)
 Initialize the object.
 
virtual bool close ()
 Shut the object down.
 
virtual bool configure (yarp::os::Searchable &config)
 Change parameters.
 
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.
 
virtual void train ()
 Train the learning machine on the examples that have been supplied so far.
 
virtual Prediction predict (const yarp::sig::Vector &input)=0
 Ask the learning machine to predict the output for a given input.
 
virtual IMachineLearnerclone ()=0
 Asks the learning machine to return a clone of its type.
 
virtual void reset ()=0
 Forget everything and start over.
 
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.
 
virtual std::string getConfigHelp ()
 Asks the learning machine to return a string containing the list of configuration options that it supports.
 
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.
 

Protected Member Functions

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

Protected Attributes

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

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

◆ close()

virtual bool iCub::learningmachine::IMachineLearner::close ( )
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::DatasetRecorder, iCub::learningmachine::DummyLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::LSSVMLearner, and iCub::learningmachine::RLSLearner.

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

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

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

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

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

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

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: