iCub-main
|
The ScaleTransformer is a ITransformer that supports element-based scaling transformations. More...
#include <ScaleTransformer.h>
Public Member Functions | |
ScaleTransformer (unsigned int dom=1) | |
Constructor. | |
ScaleTransformer (const ScaleTransformer &other) | |
Copy constructor. | |
virtual | ~ScaleTransformer () |
Destructor. | |
ScaleTransformer & | operator= (const ScaleTransformer &other) |
Assignment operator. | |
virtual ScaleTransformer * | clone () |
Asks the transformer to return a new object of its type. | |
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 std::string | getConfigHelp () |
Asks the transformer to return a string containing the list of configuration options that it supports. | |
virtual void | setDomainSize (unsigned int size) |
Mutator for the domain size. | |
virtual void | setCoDomainSize (unsigned int size) |
Mutator for the codomain size. | |
virtual void | reset () |
Forget everything and start over. | |
virtual bool | configure (yarp::os::Searchable &config) |
Public Member Functions inherited from iCub::learningmachine::IFixedSizeTransformer | |
IFixedSizeTransformer (unsigned int dom=1, unsigned int cod=1) | |
Constructor. | |
unsigned int | getDomainSize () const |
Returns the size (dimensionality) of the input domain. | |
unsigned int | getCoDomainSize () const |
Returns the size (dimensionality) of the output domain (codomain). | |
Public Member Functions inherited from iCub::learningmachine::ITransformer | |
ITransformer () | |
Constructor. | |
virtual | ~ITransformer () |
Destructor (empty). | |
std::string | getName () const |
Retrieve the name of this transformer. | |
void | setName (std::string name) |
Set the name of this transformer. | |
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 | |
void | deleteAll () |
Resets the vector of scalers and deletes each element. | |
void | deleteAll (int size) |
Resets the vector of scalers and deletes each element. | |
void | setAt (int index, std::string type) |
Sets the scaler at a certain position to a given type. | |
IScaler * | getAt (int index) |
Returns a pointer to the scaler at a certain position. | |
void | setAll (std::string type) |
Sets all scalers to a given type. | |
virtual void | writeBottle (yarp::os::Bottle &bot) |
virtual void | readBottle (yarp::os::Bottle &bot) |
Unserializes a transformer from a bottle. | |
Protected Member Functions inherited from iCub::learningmachine::IFixedSizeTransformer | |
virtual bool | checkDomainSize (const yarp::sig::Vector &input) |
Checks whether the input is of the desired dimensionality. | |
virtual bool | checkCoDomainSize (const yarp::sig::Vector &output) |
Checks whether the output is of the desired dimensionality. | |
void | validateDomainSizes (const yarp::sig::Vector &input, const yarp::sig::Vector &output) |
Validates whether the input and output are of the desired dimensionality. | |
virtual void | writeBottle (yarp::os::Bottle &bot) const |
Writes a serialization of the transformer into a bottle. | |
Protected Attributes | |
std::vector< IScaler * > | scalers |
The vector of IScaler objects. | |
Protected Attributes inherited from iCub::learningmachine::IFixedSizeTransformer | |
unsigned int | domainSize |
The dimensionality of the input domain. | |
unsigned int | coDomainSize |
The dimensionality of the output domain (codomain). | |
Protected Attributes inherited from iCub::learningmachine::ITransformer | |
std::string | name |
The name of this type of transformer. | |
int | sampleCount |
Number of samples transformed since initialization. | |
The ScaleTransformer is a ITransformer that supports element-based scaling transformations.
These transformations include standardization, normalization and other kind of linear scalings based on an offset and scale. The type and configuration can be set for individual elements in the input vectors.
Definition at line 46 of file ScaleTransformer.h.
iCub::learningmachine::ScaleTransformer::ScaleTransformer | ( | unsigned int | dom = 1 | ) |
Constructor.
dom | initial domain/codomain size |
Definition at line 31 of file ScaleTransformer.cpp.
iCub::learningmachine::ScaleTransformer::ScaleTransformer | ( | const ScaleTransformer & | other | ) |
Copy constructor.
Definition at line 40 of file ScaleTransformer.cpp.
|
virtual |
Destructor.
Definition at line 36 of file ScaleTransformer.cpp.
|
inlinevirtual |
Asks the transformer to return a new object of its type.
Implements iCub::learningmachine::ITransformer.
Definition at line 122 of file ScaleTransformer.h.
|
virtual |
Reimplemented from iCub::learningmachine::IFixedSizeTransformer.
Definition at line 171 of file ScaleTransformer.cpp.
|
protected |
Resets the vector of scalers and deletes each element.
Definition at line 70 of file ScaleTransformer.cpp.
|
protected |
Resets the vector of scalers and deletes each element.
size | the desired size of the vector |
Definition at line 74 of file ScaleTransformer.cpp.
|
protected |
Returns a pointer to the scaler at a certain position.
index | the index of the scaler |
runtime | error if the index is out of bounds |
Definition at line 61 of file ScaleTransformer.cpp.
|
virtual |
Asks the transformer to return a string containing the list of configuration options that it supports.
Reimplemented from iCub::learningmachine::IFixedSizeTransformer.
Definition at line 140 of file ScaleTransformer.cpp.
|
virtual |
Asks the transformer to return a string containing statistics on its operation so far.
Reimplemented from iCub::learningmachine::IFixedSizeTransformer.
Definition at line 128 of file ScaleTransformer.cpp.
ScaleTransformer & iCub::learningmachine::ScaleTransformer::operator= | ( | const ScaleTransformer & | other | ) |
Assignment operator.
Definition at line 48 of file ScaleTransformer.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 |
Reimplemented from iCub::learningmachine::IFixedSizeTransformer.
Definition at line 160 of file ScaleTransformer.cpp.
|
virtual |
Forget everything and start over.
Reimplemented from iCub::learningmachine::ITransformer.
Definition at line 123 of file ScaleTransformer.cpp.
|
protected |
Sets all scalers to a given type.
Definition at line 93 of file ScaleTransformer.cpp.
|
protected |
Sets the scaler at a certain position to a given type.
index | the index of the scaler to change |
type | the key identifier of the desired scaler |
Definition at line 83 of file ScaleTransformer.cpp.
|
virtual |
Mutator for the codomain size.
size | the desired codomain size |
Reimplemented from iCub::learningmachine::IFixedSizeTransformer.
Definition at line 118 of file ScaleTransformer.cpp.
|
virtual |
Mutator for the domain size.
size | the desired domain size |
Reimplemented from iCub::learningmachine::IFixedSizeTransformer.
Definition at line 111 of file ScaleTransformer.cpp.
|
virtual |
Transforms an input vector.
input | the input vector |
Reimplemented from iCub::learningmachine::IFixedSizeTransformer.
Definition at line 100 of file ScaleTransformer.cpp.
|
protectedvirtual |
Definition at line 149 of file ScaleTransformer.cpp.
|
protected |
The vector of IScaler objects.
Definition at line 51 of file ScaleTransformer.h.