iCub-main
|
A generalized interface for a learning machine for offline and online learning machines (e.g. More...
#include <IMachineLearner.h>
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 IMachineLearner * | clone ()=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. | |
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.
Definition at line 88 of file IMachineLearner.h.
|
inline |
Constructor.
Definition at line 117 of file IMachineLearner.h.
|
inlinevirtual |
Destructor (empty).
Definition at line 122 of file IMachineLearner.h.
|
pure virtual |
Asks the learning machine to return a clone of its type.
Implemented in iCub::learningmachine::DatasetRecorder, iCub::learningmachine::DummyLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::LSSVMLearner, and iCub::learningmachine::RLSLearner.
|
inlinevirtual |
Shut the object down.
Definition at line 133 of file IMachineLearner.h.
|
inlinevirtual |
Change parameters.
Reimplemented in iCub::learningmachine::DatasetRecorder, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::LSSVMLearner, and iCub::learningmachine::RLSLearner.
Definition at line 138 of file IMachineLearner.h.
|
pure virtual |
Provide the learning machine with an example of the desired mapping.
input | a sample input |
output | the corresponding output |
Implemented in iCub::learningmachine::DatasetRecorder, iCub::learningmachine::DummyLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::LSSVMLearner, and iCub::learningmachine::RLSLearner.
|
inlinevirtual |
Asks the learning machine to initialize from a string serialization.
Definition at line 232 of file IMachineLearner.h.
|
inlinevirtual |
Asks the learning machine to return a string containing the list of configuration options that it supports.
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.
|
inlinevirtual |
Asks the learning machine to return a string containing information on its operation 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 201 of file IMachineLearner.h.
|
inline |
Retrieve the name of this machine learning technique.
Definition at line 243 of file IMachineLearner.h.
|
inlinevirtual |
Initialize the object.
Definition at line 128 of file IMachineLearner.h.
|
pure virtual |
Ask the learning machine to predict the output for a given input.
input | the input |
Implemented in iCub::learningmachine::DatasetRecorder, iCub::learningmachine::DummyLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::LSSVMLearner, and iCub::learningmachine::RLSLearner.
|
inline |
Definition at line 188 of file IMachineLearner.h.
|
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.
bot | the bottle |
Implemented in iCub::learningmachine::DatasetRecorder, iCub::learningmachine::DummyLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::LSSVMLearner, and iCub::learningmachine::RLSLearner.
|
pure virtual |
Forget everything and start over.
Implemented in iCub::learningmachine::DatasetRecorder, iCub::learningmachine::DummyLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::LSSVMLearner, and iCub::learningmachine::RLSLearner.
|
inline |
Set the name of this machine learning technique.
name | the new name |
Definition at line 252 of file IMachineLearner.h.
|
inlinevirtual |
Asks the learning machine to return a string serialization.
Definition at line 221 of file IMachineLearner.h.
|
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.
|
inline |
Definition at line 179 of file IMachineLearner.h.
|
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.
bot | the bottle containing the machine serialization |
Implemented in iCub::learningmachine::DatasetRecorder, iCub::learningmachine::DummyLearner, and iCub::learningmachine::IFixedSizeLearner.
|
protected |
The name of this type of machine learner.
Definition at line 93 of file IMachineLearner.h.