iCub-main
|
An generalized interface for an ITransformer with a fixed domain and codomain size. More...
#include <IFixedSizeTransformer.h>
Public Member Functions | |
IFixedSizeTransformer (unsigned int dom=1, unsigned int cod=1) | |
Constructor. More... | |
virtual yarp::sig::Vector | transform (const yarp::sig::Vector &input) |
Transforms an input vector. 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... | |
virtual void | setDomainSize (unsigned int size) |
Mutator for the domain size. More... | |
virtual void | setCoDomainSize (unsigned int size) |
Mutator for the codomain size. More... | |
virtual std::string | getInfo () |
Asks the transformer to return a string containing statistics on its operation so far. More... | |
virtual std::string | getConfigHelp () |
Asks the transformer to return a string containing the list of configuration options that it supports. More... | |
virtual bool | configure (yarp::os::Searchable &config) |
Public Member Functions inherited from iCub::learningmachine::ITransformer | |
ITransformer () | |
Constructor. More... | |
virtual | ~ITransformer () |
Destructor (empty). 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 ITransformer * | clone ()=0 |
Asks the transformer to return a new object of its type. More... | |
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 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 transformer into a bottle. More... | |
virtual void | readBottle (yarp::os::Bottle &bot) |
Unserializes a transformer from a bottle. More... | |
Protected Attributes | |
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::ITransformer | |
std::string | name |
The name of this type of transformer. More... | |
int | sampleCount |
Number of samples transformed since initialization. More... | |
An generalized interface for an ITransformer with a fixed domain and codomain size.
Many simple preprocessing methods fall in this category.
Definition at line 39 of file IFixedSizeTransformer.h.
|
inline |
Constructor.
dom | the initial domain size |
cod | the initial codomain size |
Definition at line 97 of file IFixedSizeTransformer.h.
|
inlineprotectedvirtual |
Checks whether the output is of the desired dimensionality.
output | a sample output |
Definition at line 67 of file IFixedSizeTransformer.h.
|
inlineprotectedvirtual |
Checks whether the input is of the desired dimensionality.
input | a sample input |
Definition at line 57 of file IFixedSizeTransformer.h.
|
virtual |
Reimplemented from iCub::learningmachine::ITransformer.
Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.
Definition at line 43 of file IFixedSizeTransformer.cpp.
|
inline |
Returns the size (dimensionality) of the output domain (codomain).
Definition at line 118 of file IFixedSizeTransformer.h.
|
virtual |
Asks the transformer to return a string containing the list of configuration options that it supports.
Reimplemented from iCub::learningmachine::ITransformer.
Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.
Definition at line 78 of file IFixedSizeTransformer.cpp.
|
inline |
Returns the size (dimensionality) of the input domain.
Definition at line 109 of file IFixedSizeTransformer.h.
|
virtual |
Asks the transformer to return a string containing statistics on its operation so far.
Reimplemented from iCub::learningmachine::ITransformer.
Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.
Definition at line 70 of file IFixedSizeTransformer.cpp.
|
protectedvirtual |
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.
bot | the bottle |
Implements iCub::learningmachine::ITransformer.
Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.
Definition at line 64 of file IFixedSizeTransformer.cpp.
|
inlinevirtual |
Mutator for the codomain size.
size | the desired codomain size |
Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.
Definition at line 136 of file IFixedSizeTransformer.h.
|
inlinevirtual |
Mutator for the domain size.
size | the desired domain size |
Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.
Definition at line 127 of file IFixedSizeTransformer.h.
|
virtual |
Transforms an input vector.
input | the input vector |
Reimplemented from iCub::learningmachine::ITransformer.
Reimplemented in iCub::learningmachine::SparseSpectrumFeature, iCub::learningmachine::ScaleTransformer, and iCub::learningmachine::RandomFeature.
Definition at line 27 of file IFixedSizeTransformer.cpp.
|
protected |
Validates whether the input and output are of the desired dimensionality.
An exception will be thrown if this is not the case.
input | a sample input |
output | the corresponding output |
Definition at line 34 of file IFixedSizeTransformer.cpp.
|
protectedvirtual |
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.
bot | the bottle containing the transformer serialization |
Implements iCub::learningmachine::ITransformer.
Reimplemented in iCub::learningmachine::RandomFeature.
Definition at line 59 of file IFixedSizeTransformer.cpp.
|
protected |
The dimensionality of the output domain (codomain).
Definition at line 49 of file IFixedSizeTransformer.h.
|
protected |
The dimensionality of the input domain.
Definition at line 44 of file IFixedSizeTransformer.h.