Darwin  1.10(beta)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
drwnFeatureMap Class Referenceabstract

Defines the interface for a feature mapping $\phi : \mathbb{R}^n \rightarrow \mathbb{R}^m$. More...

Inheritance diagram for drwnFeatureMap:
drwnTypeable drwnCloneable drwnBiasFeatureMap drwnIdentityFeatureMap drwnQuadraticFeatureMap drwnSquareFeatureMap

Public Member Functions

 drwnFeatureMap ()
 default constructor
 
 drwnFeatureMap (int nFeatures)
 construct with known number of input features
 
virtual ~drwnFeatureMap ()
 destructor
 
virtual drwnFeatureMapclone () const =0
 returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); }
 
int numFeatures () const
 returns the number of features in the input space
 
virtual int numParameters () const =0
 returns the number of features in the output space
 
virtual void initialize (int nFeatures)
 initialize number of (intput) features
 
virtual vector< double > operator() (const vector< double > &x) const =0
 returns $\phi(x) \in \mathbb{R}^m$ where $x \in \mathbb{R}^n$
 
virtual double dot (const vector< double > &theta, const vector< double > &x) const
 returns the dot product $\theta^T \phi(x)$ (default behaviour is very inefficient)
 
virtual void mac (vector< double > &theta, const vector< double > &x, double alpha) const
 provides multiply-accumulate operation $\theta = \theta + \alpha \phi(x)$ (default behaviour is very inefficient)
 
- Public Member Functions inherited from drwnTypeable
virtual const char * type () const =0
 returns object type as a string (e.g., Foo::type() { return "Foo"; })
 

Protected Attributes

int _nFeatures
 number of input features
 

Detailed Description

Defines the interface for a feature mapping $\phi : \mathbb{R}^n \rightarrow \mathbb{R}^m$.

Warning
The default behaviour of all virtual functions are very inefficient and should be replaced in the derived classes. They are provided for testing during development, requiring the programmer to only implement the operator()(const vector<double>& x) function.
See Also
drwnJointFeatureMap
Feature Space Mappings

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