iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::learningmachine::ITransformer Class Referenceabstract

A class that provides a preprocessing interface, which can be used to preprocess the data samples that have been received by the MachineLearner. More...

#include <ITransformer.h>

+ Inheritance diagram for iCub::learningmachine::ITransformer:

Public Member Functions

 ITransformer ()
 Constructor. More...
 
virtual ~ITransformer ()
 Destructor (empty). More...
 
virtual yarp::sig::Vector transform (const yarp::sig::Vector &input)
 Transforms an input vector. More...
 
virtual std::string getInfo ()
 Asks the transformer to return a string containing statistics on its operation so far. More...
 
virtual void reset ()
 Forget everything and start over. More...
 
std::string getName () const
 Retrieve the name of this transformer. More...
 
void setName (std::string name)
 Set the name of this transformer. More...
 
virtual std::string getConfigHelp ()
 Asks the transformer to return a string containing the list of configuration options that it supports. More...
 
virtual ITransformerclone ()=0
 Asks the transformer to return a new object of its type. More...
 
virtual bool configure (yarp::os::Searchable &config)
 
bool write (yarp::os::ConnectionWriter &connection) const
 
bool read (yarp::os::ConnectionReader &connection)
 
virtual std::string toString ()
 Asks the transformer to return a string serialization. More...
 
virtual bool fromString (const std::string &str)
 Asks the transformer to initialize from a string serialization. More...
 

Protected Member Functions

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

Protected Attributes

std::string name
 The name of this type of transformer. More...
 
int sampleCount
 Number of samples transformed since initialization. More...
 

Detailed Description

A class that provides a preprocessing interface, which can be used to preprocess the data samples that have been received by the MachineLearner.

See also
iCub::learningmachine::Standardizer
iCub::learningmachine::Normalizer
Author
Arjan Gijsberts

Definition at line 57 of file ITransformer.h.

Constructor & Destructor Documentation

◆ ITransformer()

iCub::learningmachine::ITransformer::ITransformer ( )
inline

Constructor.

Definition at line 91 of file ITransformer.h.

◆ ~ITransformer()

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

Destructor (empty).

Definition at line 96 of file ITransformer.h.

Member Function Documentation

◆ clone()

virtual ITransformer* iCub::learningmachine::ITransformer::clone ( )
pure virtual

Asks the transformer to return a new object of its type.

Returns
a fresh instance of the current class

Implemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.

◆ configure()

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

◆ fromString()

virtual bool iCub::learningmachine::ITransformer::fromString ( const std::string &  str)
inlinevirtual

Asks the transformer to initialize from a string serialization.

Returns
true on succes

Definition at line 205 of file ITransformer.h.

◆ getConfigHelp()

virtual std::string iCub::learningmachine::ITransformer::getConfigHelp ( )
inlinevirtual

Asks the transformer 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::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, iCub::learningmachine::RandomFeature, and iCub::learningmachine::IFixedSizeTransformer.

Definition at line 153 of file ITransformer.h.

◆ getInfo()

virtual std::string iCub::learningmachine::ITransformer::getInfo ( )
inlinevirtual

Asks the transformer to return a string containing statistics on its operation so far.

Returns
the statistics of the transformer

Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, iCub::learningmachine::RandomFeature, and iCub::learningmachine::IFixedSizeTransformer.

Definition at line 115 of file ITransformer.h.

◆ getName()

std::string iCub::learningmachine::ITransformer::getName ( ) const
inline

Retrieve the name of this transformer.

Returns
the name of this transformer

Definition at line 134 of file ITransformer.h.

◆ read()

bool iCub::learningmachine::ITransformer::read ( yarp::os::ConnectionReader &  connection)
inline

Definition at line 182 of file ITransformer.h.

◆ readBottle()

virtual void iCub::learningmachine::ITransformer::readBottle ( yarp::os::Bottle &  bot)
protectedpure virtual

Unserializes a transformer 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::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, iCub::learningmachine::RandomFeature, and iCub::learningmachine::IFixedSizeTransformer.

◆ reset()

virtual void iCub::learningmachine::ITransformer::reset ( )
inlinevirtual

Forget everything and start over.

Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.

Definition at line 125 of file ITransformer.h.

◆ setName()

void iCub::learningmachine::ITransformer::setName ( std::string  name)
inline

Set the name of this transformer.

Parameters
namethe new name

Definition at line 143 of file ITransformer.h.

◆ toString()

virtual std::string iCub::learningmachine::ITransformer::toString ( )
inlinevirtual

Asks the transformer to return a string serialization.

Returns
a string serialization of the transformer

Definition at line 194 of file ITransformer.h.

◆ transform()

virtual yarp::sig::Vector iCub::learningmachine::ITransformer::transform ( const yarp::sig::Vector &  input)
inlinevirtual

Transforms an input vector.

Parameters
inputthe input vector
Returns
the output vector

Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, iCub::learningmachine::RandomFeature, and iCub::learningmachine::IFixedSizeTransformer.

Definition at line 104 of file ITransformer.h.

◆ write()

bool iCub::learningmachine::ITransformer::write ( yarp::os::ConnectionWriter &  connection) const
inline

Definition at line 173 of file ITransformer.h.

◆ writeBottle()

virtual void iCub::learningmachine::ITransformer::writeBottle ( yarp::os::Bottle &  bot) const
protectedpure virtual

Writes a serialization of the transformer 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 transformer serialization

Implemented in iCub::learningmachine::RandomFeature, and iCub::learningmachine::IFixedSizeTransformer.

Member Data Documentation

◆ name

std::string iCub::learningmachine::ITransformer::name
protected

The name of this type of transformer.

Definition at line 62 of file ITransformer.h.

◆ sampleCount

int iCub::learningmachine::ITransformer::sampleCount
protected

Number of samples transformed since initialization.

Definition at line 67 of file ITransformer.h.


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