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

Implementation of Random Feature preprocessing. More...

#include <RandomFeature.h>

+ Inheritance diagram for iCub::learningmachine::RandomFeature:

Public Member Functions

 RandomFeature (unsigned int dom=1, unsigned int cod=1, double gamma=1.)
 Constructor.
 
virtual ~RandomFeature ()
 Destructor (empty).
 
virtual RandomFeatureclone ()
 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)
 
virtual double getGamma () const
 Accessor for the gamma parameter.
 
virtual void setGamma (double g)
 Mutator for the gamma parameter.
 
- 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

virtual void writeBottle (yarp::os::Bottle &bot) const
 Writes a serialization of the transformer into a bottle.
 
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.
 

Protected Attributes

double gamma
 Gamma parameter, analoguous to same parameter in RBF kernel.
 
yarp::sig::Matrix W
 Projection matrix W.
 
yarp::sig::Vector b
 Bias vector b.
 
- 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.
 

Detailed Description

Implementation of Random Feature preprocessing.

See also
iCub::learningmachine::SparseSpectrumFeature

See: Random Features for Large-Scale Kernel Machines. Ali Rahimi and Ben Recht. In Neural Information Processing Systems (NIPS) 2007.

Author
Arjan Gijsberts

Definition at line 45 of file RandomFeature.h.

Constructor & Destructor Documentation

◆ RandomFeature()

iCub::learningmachine::RandomFeature::RandomFeature ( unsigned int  dom = 1,
unsigned int  cod = 1,
double  gamma = 1. 
)

Constructor.

Parameters
dominitial domain size
codinitial codomain size
ginitial value for \gamma

Definition at line 39 of file RandomFeature.cpp.

◆ ~RandomFeature()

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

Destructor (empty).

Definition at line 85 of file RandomFeature.h.

Member Function Documentation

◆ clone()

virtual RandomFeature * iCub::learningmachine::RandomFeature::clone ( )
inlinevirtual

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

Returns
a fresh instance of the current class

Implements iCub::learningmachine::ITransformer.

Definition at line 90 of file RandomFeature.h.

◆ configure()

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

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 111 of file RandomFeature.cpp.

◆ getConfigHelp()

std::string iCub::learningmachine::RandomFeature::getConfigHelp ( )
virtual

Asks the transformer to return a string containing the list of configuration options that it supports.

Returns
an informative description of the configuration options

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 104 of file RandomFeature.cpp.

◆ getGamma()

virtual double iCub::learningmachine::RandomFeature::getGamma ( ) const
inlinevirtual

Accessor for the gamma parameter.

Returns
gamma.

Definition at line 134 of file RandomFeature.h.

◆ getInfo()

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

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

Returns
the statistics of the transformer

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 97 of file RandomFeature.cpp.

◆ readBottle()

void iCub::learningmachine::RandomFeature::readBottle ( yarp::os::Bottle &  bot)
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.

Parameters
botthe bottle

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 88 of file RandomFeature.cpp.

◆ reset()

void iCub::learningmachine::RandomFeature::reset ( )
virtual

Forget everything and start over.

Reimplemented from iCub::learningmachine::ITransformer.

Definition at line 69 of file RandomFeature.cpp.

◆ setCoDomainSize()

void iCub::learningmachine::RandomFeature::setCoDomainSize ( unsigned int  size)
virtual

Mutator for the codomain size.

Parameters
sizethe desired codomain size

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 62 of file RandomFeature.cpp.

◆ setDomainSize()

void iCub::learningmachine::RandomFeature::setDomainSize ( unsigned int  size)
virtual

Mutator for the domain size.

Parameters
sizethe desired domain size

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 55 of file RandomFeature.cpp.

◆ setGamma()

virtual void iCub::learningmachine::RandomFeature::setGamma ( double  g)
inlinevirtual

Mutator for the gamma parameter.

Parameters
gthe desired gamma.

Definition at line 143 of file RandomFeature.h.

◆ transform()

yarp::sig::Vector iCub::learningmachine::RandomFeature::transform ( const yarp::sig::Vector &  input)
virtual

Transforms an input vector.

Parameters
inputthe input vector
Returns
the output vector

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 47 of file RandomFeature.cpp.

◆ writeBottle()

void iCub::learningmachine::RandomFeature::writeBottle ( yarp::os::Bottle &  bot) const
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.

Parameters
botthe bottle containing the transformer serialization

Reimplemented from iCub::learningmachine::IFixedSizeTransformer.

Definition at line 82 of file RandomFeature.cpp.

Member Data Documentation

◆ b

yarp::sig::Vector iCub::learningmachine::RandomFeature::b
protected

Bias vector b.

Definition at line 60 of file RandomFeature.h.

◆ gamma

double iCub::learningmachine::RandomFeature::gamma
protected

Gamma parameter, analoguous to same parameter in RBF kernel.

Definition at line 50 of file RandomFeature.h.

◆ W

yarp::sig::Matrix iCub::learningmachine::RandomFeature::W
protected

Projection matrix W.

Definition at line 55 of file RandomFeature.h.


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