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

A class that implements normalization as a preprocessing step. More...

#include <Normalizer.h>

+ Inheritance diagram for iCub::learningmachine::Normalizer:

Public Member Functions

 Normalizer (double l=-1, double u=1)
 Constructor. 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 std::string getInfo ()
 Asks the learning machine to return a string containing statistics on its operation so far. More...
 
virtual bool configure (yarp::os::Searchable &config)
 
Normalizerclone ()
 Asks the scaler to return a new object of its type. More...
 
virtual double getLowerBound ()
 Accessor for the desired lower bound. More...
 
virtual void setLowerBound (double l)
 Mutator for the desired lower bound. More...
 
virtual double getUpperBound ()
 Accessor for the desired upper bound. More...
 
virtual void setUpperBound (double u)
 Mutator for the desired upper bound. More...
 
- Public Member Functions inherited from iCub::learningmachine::IScaler
 IScaler (double s=1., double o=0.)
 Constructor. More...
 
virtual ~IScaler ()
 Destructor (empty). 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...
 
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 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...
 

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 lowest
 The actual lowest value found in the sample values. More...
 
double highest
 The actual highest value found in the sample values. More...
 
double lowerBound
 The desired lower bound for the normalization range. More...
 
double upperBound
 The desired upper bound for the normalization range. More...
 
- Protected Attributes inherited from iCub::learningmachine::IScaler
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

A class that implements normalization as a preprocessing step.

This normalizer limits all values between a predesignated range. By default this range is defined as [-1, 1].

See also
iCub::learningmachine::IScaler
Author
Arjan Gijsberts

Definition at line 40 of file Normalizer.h.

Constructor & Destructor Documentation

◆ Normalizer()

iCub::learningmachine::Normalizer::Normalizer ( double  l = -1,
double  u = 1 
)

Constructor.

Parameters
lthe initial lower bound
uthe initial upper bound

Definition at line 32 of file Normalizer.cpp.

Member Function Documentation

◆ clone()

Normalizer* iCub::learningmachine::Normalizer::clone ( )
inlinevirtual

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

Returns
a fresh instance of the specified type

Implements iCub::learningmachine::IScaler.

Definition at line 99 of file Normalizer.h.

◆ configure()

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

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 75 of file Normalizer.cpp.

◆ getInfo()

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

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

Returns
the statistics of the machine

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 53 of file Normalizer.cpp.

◆ getLowerBound()

virtual double iCub::learningmachine::Normalizer::getLowerBound ( )
inlinevirtual

Accessor for the desired lower bound.

Definition at line 106 of file Normalizer.h.

◆ getUpperBound()

virtual double iCub::learningmachine::Normalizer::getUpperBound ( )
inlinevirtual

Accessor for the desired upper bound.

Definition at line 118 of file Normalizer.h.

◆ readBottle()

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

Unserializes a scaler from a bottle.

Parameters
botthe bottle

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 68 of file Normalizer.cpp.

◆ setLowerBound()

virtual void iCub::learningmachine::Normalizer::setLowerBound ( double  l)
inlinevirtual

Mutator for the desired lower bound.

Parameters
lthe new lower bound

Definition at line 113 of file Normalizer.h.

◆ setUpperBound()

virtual void iCub::learningmachine::Normalizer::setUpperBound ( double  u)
inlinevirtual

Mutator for the desired upper bound.

Parameters
uthe new upper bound

Definition at line 125 of file Normalizer.h.

◆ update()

void iCub::learningmachine::Normalizer::update ( double  val)
virtual

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 from iCub::learningmachine::IScaler.

Definition at line 37 of file Normalizer.cpp.

◆ writeBottle()

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

Writes a serialization of the scaler into a bottle.

Parameters
botthe bottle

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 61 of file Normalizer.cpp.

Member Data Documentation

◆ highest

double iCub::learningmachine::Normalizer::highest
protected

The actual highest value found in the sample values.

Definition at line 50 of file Normalizer.h.

◆ lowerBound

double iCub::learningmachine::Normalizer::lowerBound
protected

The desired lower bound for the normalization range.

Definition at line 55 of file Normalizer.h.

◆ lowest

double iCub::learningmachine::Normalizer::lowest
protected

The actual lowest value found in the sample values.

Definition at line 45 of file Normalizer.h.

◆ upperBound

double iCub::learningmachine::Normalizer::upperBound
protected

The desired upper bound for the normalization range.

Definition at line 60 of file Normalizer.h.


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