iCub-main
|
This is basic implementation of the LSSVM algorithms. More...
#include <LSSVMLearner.h>
Public Member Functions | |
LSSVMLearner (unsigned int dom=1, unsigned int cod=1, double c=1.0) | |
Constructor. More... | |
LSSVMLearner (const LSSVMLearner &other) | |
Copy Constructor. More... | |
virtual | ~LSSVMLearner () |
Destructor. More... | |
virtual LSSVMLearner & | operator= (const LSSVMLearner &other) |
Assignment operator. More... | |
virtual void | feedSample (const yarp::sig::Vector &input, const yarp::sig::Vector &output) |
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... | |
Prediction | predict (const yarp::sig::Vector &input) |
Ask the learning machine to predict the output for a given input. More... | |
void | reset () |
Forget everything and start over. More... | |
LSSVMLearner * | clone () |
Asks the learning machine to return a clone of its type. More... | |
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 void | writeBottle (yarp::os::Bottle &bot) |
virtual void | readBottle (yarp::os::Bottle &bot) |
Unserializes a machine from a bottle. More... | |
void | setDomainSize (unsigned int size) |
Mutator for the domain size. More... | |
void | setCoDomainSize (unsigned int size) |
Mutator for the codomain size. More... | |
virtual bool | configure (yarp::os::Searchable &config) |
Change parameters. More... | |
virtual void | setC (double C) |
Mutator for the regularization parameter C. More... | |
virtual double | getC () |
Accessor for the regularization parameter C. More... | |
virtual RBFKernel * | getKernel () |
Accessor for the kernel. More... | |
Public Member Functions inherited from iCub::learningmachine::IFixedSizeLearner | |
IFixedSizeLearner (unsigned int dom=1, unsigned int cod=1) | |
Constructor. More... | |
unsigned int | getDomainSize () const |
Returns the size (dimensionality) of the input domain. More... | |
unsigned int | getCoDomainSize () const |
Returns the size (dimensionality) of the output domain (codomain). More... | |
Public Member Functions inherited from iCub::learningmachine::IMachineLearner | |
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... | |
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. 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... | |
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. More... | |
virtual bool | checkCoDomainSize (const yarp::sig::Vector &output) |
Checks whether the output is of the desired dimensionality. More... | |
void | validateDomainSizes (const yarp::sig::Vector &input, const yarp::sig::Vector &output) |
Validates whether the input and output are of the desired dimensionality. More... | |
virtual void | writeBottle (yarp::os::Bottle &bot) const |
Writes a serialization of the machine into a bottle. More... | |
Protected Attributes inherited from iCub::learningmachine::IFixedSizeLearner | |
unsigned int | domainSize |
The dimensionality of the input domain. More... | |
unsigned int | coDomainSize |
The dimensionality of the output domain (codomain). More... | |
Protected Attributes inherited from iCub::learningmachine::IMachineLearner | |
std::string | name |
The name of this type of machine learner. More... | |
This is basic implementation of the LSSVM algorithms.
Note that for efficiency the hyperparameters are shared among all outputs. Only the RBF kernel function is supported.
Definition at line 120 of file LSSVMLearner.h.
iCub::learningmachine::LSSVMLearner::LSSVMLearner | ( | unsigned int | dom = 1 , |
unsigned int | cod = 1 , |
||
double | c = 1.0 |
||
) |
Constructor.
dom | initial domain size |
cod | initial codomain size |
c | initial value for regularization parameter C |
Definition at line 49 of file LSSVMLearner.cpp.
iCub::learningmachine::LSSVMLearner::LSSVMLearner | ( | const LSSVMLearner & | other | ) |
Copy Constructor.
Definition at line 59 of file LSSVMLearner.cpp.
|
virtual |
Destructor.
Definition at line 66 of file LSSVMLearner.cpp.
|
virtual |
Asks the learning machine to return a clone of its type.
Implements iCub::learningmachine::IMachineLearner.
Definition at line 169 of file LSSVMLearner.cpp.
|
virtual |
Change parameters.
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 256 of file LSSVMLearner.cpp.
|
virtual |
Provide the learning machine with an example of the desired mapping.
input | a sample input |
output | the corresponding output |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 86 of file LSSVMLearner.cpp.
|
inlinevirtual |
Accessor for the regularization parameter C.
Definition at line 257 of file LSSVMLearner.h.
|
virtual |
Asks the learning machine to return a string containing the list of configuration options that it supports.
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 184 of file LSSVMLearner.cpp.
|
virtual |
Asks the learning machine to return a string containing information on its operation so far.
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 173 of file LSSVMLearner.cpp.
|
inlinevirtual |
Accessor for the kernel.
Definition at line 266 of file LSSVMLearner.h.
|
virtual |
Assignment operator.
Definition at line 70 of file LSSVMLearner.cpp.
|
virtual |
Ask the learning machine to predict the output for a given input.
input | the input |
Implements iCub::learningmachine::IMachineLearner.
Definition at line 145 of file LSSVMLearner.cpp.
|
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 |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 218 of file LSSVMLearner.cpp.
|
virtual |
Forget everything and start over.
Implements iCub::learningmachine::IMachineLearner.
Definition at line 161 of file LSSVMLearner.cpp.
|
inlinevirtual |
Mutator for the regularization parameter C.
C | the new value |
Definition at line 248 of file LSSVMLearner.h.
|
virtual |
Mutator for the codomain size.
size | the desired codomain size |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 251 of file LSSVMLearner.cpp.
|
virtual |
Mutator for the domain size.
size | the desired domain size |
Reimplemented from iCub::learningmachine::IFixedSizeLearner.
Definition at line 247 of file LSSVMLearner.cpp.
|
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 94 of file LSSVMLearner.cpp.
|
virtual |
Definition at line 193 of file LSSVMLearner.cpp.