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
drwnSquareJointFeatureMap Class Reference

Same as drwnIdentityJointFeatureMap but adds a square term for each feature i.e., $\phi(x, y) = \left(\delta\!\left\{y = 0\right\} (x^T, \frac{1}{\sqrt{2}} diag(xx^T - I), 1), \ldots, \delta\!\left\{y = K - 2\right\} (x^T, \frac{1}{\sqrt{2}} diag(xx^T - I), 1)\right) \in \mathbb{R}^{(K - 1)(2n + 1)}$. More...

Inheritance diagram for drwnSquareJointFeatureMap:
drwnJointFeatureMap drwnTypeable drwnCloneable

Public Member Functions

 drwnSquareJointFeatureMap (int nFeatures, int nClasses)
 
const char * type () const
 returns object type as a string (e.g., Foo::type() { return "Foo"; })
 
drwnSquareJointFeatureMapclone () const
 returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); }
 
int numParameters () const
 returns the number of features in the (joint) output space
 
void initialize (int nFeatures, int nClasses)
 initialize number of classes and number of features
 
vector< double > operator() (const vector< double > &x, int y) const
 feature vector for given y
 
vector< double > operator() (const vector< double > &x) const
 feature vector summed over y
 
double dot (const vector< double > &theta, const vector< double > &x, int y) const
 dot product
 
double dot (const vector< double > &theta, const vector< double > &x) const
 dot product
 
void mac (vector< double > &theta, const vector< double > &x, double alpha, int y) const
 multiply-accumulate
 
void mac (vector< double > &theta, const vector< double > &x, const vector< double > &alpha) const
 multiply-accumulate
 
- Public Member Functions inherited from drwnJointFeatureMap
 drwnJointFeatureMap ()
 default constructor
 
 drwnJointFeatureMap (int nFeatures, int nClasses)
 construct with known number of input features and classes
 
virtual ~drwnJointFeatureMap ()
 destructor
 
int numFeatures () const
 returns the number of features in the input space
 
int numClasses () const
 returns the number of classes
 
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)
 

Protected Attributes

int _nFeaturesDiv4
 
int _nFeaturesMod4
 
- Protected Attributes inherited from drwnJointFeatureMap
int _nFeatures
 number of input features
 
int _nClasses
 number of class labels
 

Detailed Description

Same as drwnIdentityJointFeatureMap but adds a square term for each feature i.e., $\phi(x, y) = \left(\delta\!\left\{y = 0\right\} (x^T, \frac{1}{\sqrt{2}} diag(xx^T - I), 1), \ldots, \delta\!\left\{y = K - 2\right\} (x^T, \frac{1}{\sqrt{2}} diag(xx^T - I), 1)\right) \in \mathbb{R}^{(K - 1)(2n + 1)}$.


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