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
drwnJointFeatureMap Class Referenceabstract

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

Inheritance diagram for drwnJointFeatureMap:
drwnTypeable drwnCloneable drwnBiasJointFeatureMap drwnIdentityJointFeatureMap drwnQuadraticJointFeatureMap drwnSquareJointFeatureMap

Public Member Functions

 drwnJointFeatureMap ()
 default constructor
 
 drwnJointFeatureMap (int nFeatures, int nClasses)
 construct with known number of input features and classes
 
virtual ~drwnJointFeatureMap ()
 destructor
 
virtual drwnJointFeatureMapclone () 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
 
int numClasses () const
 returns the number of classes
 
virtual int numParameters () const =0
 returns the number of features in the (joint) output space
 
virtual void initialize (int nFeatures, int nClasses)
 initialize number of classes and number of features
 
virtual vector< double > operator() (const vector< double > &x, int y) const =0
 returns $\phi(x, y) \in \mathbb{R}^m$ where $x \in \mathbb{R}^n$
 
virtual vector< double > operator() (const vector< double > &x) const
 returns $ \sum_y \phi(x, y) \in \mathbb{R}^m$ (default behaviour is very inefficient)
 
virtual double dot (const vector< double > &theta, const vector< double > &x, int y) const
 returns the dot product $\theta^T \phi(x, y)$ (default behaviour is very inefficient)
 
double dot (const vector< double > &theta, const vector< double > &x) const
 returns the dot product $\sum_y \theta^T \phi(x, y)$ (default behaviour is very inefficient)
 
virtual void mac (vector< double > &theta, const vector< double > &x, double alpha, int y) const
 provides multiply-accumulate operation $\theta = \theta + \alpha \phi(x, y)$ (default behaviour is very inefficient)
 
virtual void mac (vector< double > &theta, const vector< double > &x, const vector< double > &alpha) const
 provides multiply-accumulate operation $\theta = \theta + \sum_y \alpha_y \phi(x, y)$ (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
 
int _nClasses
 number of class labels
 

Detailed Description

Defines the interface for a joint feature mapping $\phi : \mathbb{R} \times \mathbb{Z} \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, double y) function.
See Also
drwnFeatureMap
Feature Space Mappings

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