iCub-main
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iCub::learningmachine::DatasetRecorder Class Reference

This 'machine learner' demonstrates how the IMachineLearner interface can be used to easily record samples to a file. More...

#include <DatasetRecorder.h>

+ Inheritance diagram for iCub::learningmachine::DatasetRecorder:

Public Member Functions

 DatasetRecorder ()
 Constructor.
 
 DatasetRecorder (const DatasetRecorder &other)
 Copy constructor.
 
virtual ~DatasetRecorder ()
 Destructor.
 
DatasetRecorderoperator= (const DatasetRecorder &other)
 Assignment operator.
 
virtual void feedSample (const yarp::sig::Vector &input, const yarp::sig::Vector &output)
 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.
 
Prediction predict (const yarp::sig::Vector &input)
 Ask the learning machine to predict the output for a given input.
 
void reset ()
 Forget everything and start over.
 
DatasetRecorderclone ()
 Asks the learning machine to return a clone of its type.
 
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 void writeBottle (yarp::os::Bottle &bot) const
 Writes a serialization of the machine into a bottle.
 
virtual void readBottle (yarp::os::Bottle &bot)
 Unserializes a machine from a bottle.
 
virtual bool configure (yarp::os::Searchable &config)
 Change parameters.
 
- Public Member Functions inherited from iCub::learningmachine::IMachineLearner
 IMachineLearner ()
 Constructor.
 
virtual ~IMachineLearner ()
 Destructor (empty).
 
virtual bool open (yarp::os::Searchable &config)
 Initialize the object.
 
virtual bool close ()
 Shut the object down.
 
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.
 
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.
 

Additional Inherited Members

- Protected Attributes inherited from iCub::learningmachine::IMachineLearner
std::string name
 The name of this type of machine learner.
 

Detailed Description

This 'machine learner' demonstrates how the IMachineLearner interface can be used to easily record samples to a file.

See also
iCub::contrib::IMachineLearner
Author
Arjan Gijsberts

Definition at line 41 of file DatasetRecorder.h.

Constructor & Destructor Documentation

◆ DatasetRecorder() [1/2]

iCub::learningmachine::DatasetRecorder::DatasetRecorder ( )
inline

Constructor.

Definition at line 67 of file DatasetRecorder.h.

◆ DatasetRecorder() [2/2]

iCub::learningmachine::DatasetRecorder::DatasetRecorder ( const DatasetRecorder other)
inline

Copy constructor.

Definition at line 74 of file DatasetRecorder.h.

◆ ~DatasetRecorder()

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

Destructor.

Definition at line 82 of file DatasetRecorder.h.

Member Function Documentation

◆ clone()

DatasetRecorder * iCub::learningmachine::DatasetRecorder::clone ( )
inlinevirtual

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

Returns
a clone of the current learner

Implements iCub::learningmachine::IMachineLearner.

Definition at line 121 of file DatasetRecorder.h.

◆ configure()

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

Change parameters.

Reimplemented from iCub::learningmachine::IMachineLearner.

Definition at line 95 of file DatasetRecorder.cpp.

◆ feedSample()

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

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

Parameters
inputa sample input
outputthe corresponding output

Implements iCub::learningmachine::IMachineLearner.

Definition at line 39 of file DatasetRecorder.cpp.

◆ getConfigHelp()

std::string iCub::learningmachine::DatasetRecorder::getConfigHelp ( )
virtual

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 from iCub::learningmachine::IMachineLearner.

Definition at line 87 of file DatasetRecorder.cpp.

◆ getInfo()

std::string iCub::learningmachine::DatasetRecorder::getInfo ( )
virtual

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

Returns
the information on the machine

Reimplemented from iCub::learningmachine::IMachineLearner.

Definition at line 68 of file DatasetRecorder.cpp.

◆ operator=()

DatasetRecorder & iCub::learningmachine::DatasetRecorder::operator= ( const DatasetRecorder other)

Assignment operator.

Definition at line 27 of file DatasetRecorder.cpp.

◆ predict()

Prediction iCub::learningmachine::DatasetRecorder::predict ( const yarp::sig::Vector &  input)
inlinevirtual

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

Parameters
inputthe input
Returns
the expected output

Implements iCub::learningmachine::IMachineLearner.

Definition at line 106 of file DatasetRecorder.h.

◆ readBottle()

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

Implements iCub::learningmachine::IMachineLearner.

Definition at line 82 of file DatasetRecorder.cpp.

◆ reset()

void iCub::learningmachine::DatasetRecorder::reset ( )
inlinevirtual

Forget everything and start over.

Implements iCub::learningmachine::IMachineLearner.

Definition at line 113 of file DatasetRecorder.h.

◆ train()

virtual void iCub::learningmachine::DatasetRecorder::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 from iCub::learningmachine::IMachineLearner.

Definition at line 101 of file DatasetRecorder.h.

◆ writeBottle()

void iCub::learningmachine::DatasetRecorder::writeBottle ( yarp::os::Bottle &  bot) const
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

Implements iCub::learningmachine::IMachineLearner.

Definition at line 77 of file DatasetRecorder.cpp.


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