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

#include <IScaler.h>

+ Inheritance diagram for iCub::learningmachine::IScaler:

Public Member Functions

 IScaler (double s=1., double o=0.)
 Constructor. More...
 
virtual ~IScaler ()
 Destructor (empty). More...
 
virtual void update (double val)
 Feeds a single sample into the scaler, so that it can use this sample to update the offset and scale. More...
 
virtual double transform (double val)
 Transforms a single sample value according to the state of the scaler. More...
 
virtual double unTransform (double val)
 Untransforms a single sample value according to the state of the scaler. More...
 
virtual std::string getInfo ()
 Asks the learning machine to return a string containing statistics on its operation so far. More...
 
std::string getName () const
 Retrieve the name of this scaler. More...
 
void setName (std::string name)
 Set the name of this machine learning technique. More...
 
virtual void setUpdateEnabled (bool u)
 Mutator for the update state. More...
 
virtual bool getUpdateEnabled ()
 Accessor for the update state. More...
 
virtual IScalerclone ()=0
 Asks the scaler to return a new object of its type. More...
 
virtual std::string toString ()
 Asks the scaler to return a string serialization. More...
 
virtual bool fromString (const std::string &str)
 Asks the scaler to initialize from a string serialization. More...
 
virtual bool configure (yarp::os::Searchable &config)
 

Protected Member Functions

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

Protected Attributes

double offset
 The offset for the linear transformation. More...
 
double scale
 The scale for the linear transformation. More...
 
std::string name
 The name of this type of scaler. More...
 
bool updateEnabled
 Boolean indicating whether the scaler has to update each sample. More...
 

Detailed Description

The IScaler is a linear scaler based scaler. It is used in particularly as part of the ScaleTransformer.

See also
iCub::learningmachine:ScaleTransformer
Author
Arjan Gijsberts

Definition at line 41 of file IScaler.h.

Constructor & Destructor Documentation

◆ IScaler()

iCub::learningmachine::IScaler::IScaler ( double  s = 1.,
double  o = 0. 
)
inline

Constructor.

Parameters
sthe scale for the linear transformation
othe offset for the linear transformation

Definition at line 84 of file IScaler.h.

◆ ~IScaler()

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

Destructor (empty).

Definition at line 90 of file IScaler.h.

Member Function Documentation

◆ clone()

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

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

Returns
a fresh instance of the specified type

Implemented in iCub::learningmachine::NullScaler, iCub::learningmachine::Standardizer, iCub::learningmachine::FixedRangeScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::LinearScaler.

◆ configure()

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

◆ fromString()

bool iCub::learningmachine::IScaler::fromString ( const std::string str)
virtual

Asks the scaler to initialize from a string serialization.

Returns
true on succes

Definition at line 55 of file IScaler.cpp.

◆ getInfo()

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

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

Returns
the statistics of the machine

Reimplemented in iCub::learningmachine::Standardizer, iCub::learningmachine::FixedRangeScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::LinearScaler.

Definition at line 40 of file IScaler.cpp.

◆ getName()

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

Retrieve the name of this scaler.

Returns
the name of this scaler

Definition at line 133 of file IScaler.h.

◆ getUpdateEnabled()

virtual bool iCub::learningmachine::IScaler::getUpdateEnabled ( )
inlinevirtual

Accessor for the update state.

Returns
the current update state

Definition at line 154 of file IScaler.h.

◆ readBottle()

void iCub::learningmachine::IScaler::readBottle ( yarp::os::Bottle &  bot)
protectedvirtual

Unserializes a scaler from a bottle.

Parameters
botthe bottle

Reimplemented in iCub::learningmachine::Standardizer, iCub::learningmachine::FixedRangeScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::LinearScaler.

Definition at line 67 of file IScaler.cpp.

◆ setName()

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

Set the name of this machine learning technique.

Parameters
namethe new name

Definition at line 140 of file IScaler.h.

◆ setUpdateEnabled()

virtual void iCub::learningmachine::IScaler::setUpdateEnabled ( bool  u)
inlinevirtual

Mutator for the update state.

Parameters
uthe desired boolean state

Definition at line 147 of file IScaler.h.

◆ toString()

std::string iCub::learningmachine::IScaler::toString ( )
virtual

Asks the scaler to return a string serialization.

Returns
a string serialization of the scaler

Definition at line 49 of file IScaler.cpp.

◆ transform()

double iCub::learningmachine::IScaler::transform ( double  val)
virtual

Transforms a single sample value according to the state of the scaler.

This state is usually made up out of a desired offset and scale.

Parameters
valthe sample
Returns
the resulting, transformed sample

Reimplemented in iCub::learningmachine::NullScaler.

Definition at line 30 of file IScaler.cpp.

◆ unTransform()

virtual double iCub::learningmachine::IScaler::unTransform ( double  val)
inlinevirtual

Untransforms a single sample value according to the state of the scaler.

This operation is the inverse of the transform operation.

Parameters
valthe sample
Returns
the resulting, transformed sample

Reimplemented in iCub::learningmachine::NullScaler.

Definition at line 116 of file IScaler.h.

◆ update()

virtual void iCub::learningmachine::IScaler::update ( double  val)
inlinevirtual

Feeds a single sample into the scaler, so that it can use this sample to update the offset and scale.

Parameters
valuethe sample value

Reimplemented in iCub::learningmachine::Standardizer, and iCub::learningmachine::Normalizer.

Definition at line 98 of file IScaler.h.

◆ writeBottle()

void iCub::learningmachine::IScaler::writeBottle ( yarp::os::Bottle &  bot)
protectedvirtual

Writes a serialization of the scaler into a bottle.

Parameters
botthe bottle

Reimplemented in iCub::learningmachine::Standardizer, iCub::learningmachine::FixedRangeScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::LinearScaler.

Definition at line 61 of file IScaler.cpp.

Member Data Documentation

◆ name

std::string iCub::learningmachine::IScaler::name
protected

The name of this type of scaler.

Definition at line 56 of file IScaler.h.

◆ offset

double iCub::learningmachine::IScaler::offset
protected

The offset for the linear transformation.

Definition at line 46 of file IScaler.h.

◆ scale

double iCub::learningmachine::IScaler::scale
protected

The scale for the linear transformation.

Definition at line 51 of file IScaler.h.

◆ updateEnabled

bool iCub::learningmachine::IScaler::updateEnabled
protected

Boolean indicating whether the scaler has to update each sample.

Definition at line 61 of file IScaler.h.


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