iCub-main
Loading...
Searching...
No Matches
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.
 
virtual ~ITransformer ()
 Destructor (empty).
 
virtual yarp::sig::Vector transform (const yarp::sig::Vector &input)
 Transforms an input vector.
 
virtual std::string getInfo ()
 Asks the transformer to return a string containing statistics on its operation so far.
 
virtual void reset ()
 Forget everything and start over.
 
std::string getName () const
 Retrieve the name of this transformer.
 
void setName (std::string name)
 Set the name of this transformer.
 
virtual std::string getConfigHelp ()
 Asks the transformer to return a string containing the list of configuration options that it supports.
 
virtual ITransformerclone ()=0
 Asks the transformer to return a new object of its type.
 
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.
 
virtual bool fromString (const std::string &str)
 Asks the transformer to initialize from a string serialization.
 

Protected Member Functions

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

Protected Attributes

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

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

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

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

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

◆ reset()

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

Forget everything and start over.

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

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

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::IFixedSizeTransformer, and iCub::learningmachine::RandomFeature.

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: