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. More... | |
virtual | ~IMachineLearner () |
Destructor (empty). 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 IMachineLearner * | clone ()=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... | |
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 89 of file IMachineLearner.h.
|
inline |
Constructor.
Definition at line 118 of file IMachineLearner.h.
|
inlinevirtual |
Destructor (empty).
Definition at line 123 of file IMachineLearner.h.
|
pure virtual |
Asks the learning machine to return a clone of its type.
Implemented in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.
|
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::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.
|
inlinevirtual |
Asks the learning machine to initialize from a string serialization.
Definition at line 217 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::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, and iCub::learningmachine::DatasetRecorder.
Definition at line 196 of file IMachineLearner.h.
|
inlinevirtual |
Asks the learning machine to return a string containing information on its operation 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 186 of file IMachineLearner.h.
|
inline |
Retrieve the name of this machine learning technique.
Definition at line 228 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::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.
|
inline |
Definition at line 173 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::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.
|
pure virtual |
Forget everything and start over.
Implemented in iCub::learningmachine::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.
|
inline |
Set the name of this machine learning technique.
name | the new name |
Definition at line 237 of file IMachineLearner.h.
|
inlinevirtual |
Asks the learning machine to return a string serialization.
Definition at line 206 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::RLSLearner, iCub::learningmachine::LSSVMLearner, iCub::learningmachine::LinearGPRLearner, iCub::learningmachine::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.
Definition at line 139 of file IMachineLearner.h.
|
inline |
Definition at line 164 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::IFixedSizeLearner, iCub::learningmachine::DummyLearner, and iCub::learningmachine::DatasetRecorder.
|
protected |
The name of this type of machine learner.
Definition at line 94 of file IMachineLearner.h.