iCub-main
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::learningmachine::IScaler Class Referenceabstract

The IScaler is a linear scaler based scaler. More...

#include <IScaler.h>

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

Public Member Functions

 IScaler (double s=1., double o=0.)
 Constructor.
 
virtual ~IScaler ()
 Destructor (empty).
 
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.
 
virtual double transform (double val)
 Transforms a single sample value according to the state of the scaler.
 
virtual double unTransform (double val)
 Untransforms a single sample value according to the state of the scaler.
 
virtual std::string getInfo ()
 Asks the learning machine to return a string containing statistics on its operation so far.
 
std::string getName () const
 Retrieve the name of this scaler.
 
void setName (std::string name)
 Set the name of this machine learning technique.
 
virtual void setUpdateEnabled (bool u)
 Mutator for the update state.
 
virtual bool getUpdateEnabled ()
 Accessor for the update state.
 
virtual IScalerclone ()=0
 Asks the scaler to return a new object of its type.
 
virtual std::string toString ()
 Asks the scaler to return a string serialization.
 
virtual bool fromString (const std::string &str)
 Asks the scaler to initialize from a string serialization.
 
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.
 
virtual void readBottle (yarp::os::Bottle &bot)
 Unserializes a scaler from a bottle.
 

Protected Attributes

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

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::FixedRangeScaler, iCub::learningmachine::NullScaler, iCub::learningmachine::LinearScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::Standardizer.

◆ 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::FixedRangeScaler, iCub::learningmachine::LinearScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::Standardizer.

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::FixedRangeScaler, iCub::learningmachine::LinearScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::Standardizer.

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::Normalizer, and iCub::learningmachine::Standardizer.

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::FixedRangeScaler, iCub::learningmachine::LinearScaler, iCub::learningmachine::Normalizer, and iCub::learningmachine::Standardizer.

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: