Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::SquaredErrorCostFunction Class Reference

********************************************************* The following 'kernels' are rather used as cost functions More...

#include <SquaredErrorCostFunction.h>

Inheritance diagram for PLearn::SquaredErrorCostFunction:

Inheritance graph
[legend]
Collaboration diagram for PLearn::SquaredErrorCostFunction:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SquaredErrorCostFunction (int the_targetindex=-1)
 SquaredErrorCostFunction (real hot_value, real cold_value)
 Constructor for classification (target is interpreted as onehot).

 PLEARN_DECLARE_OBJECT (SquaredErrorCostFunction)
virtual string info () const
 returns a bit more informative string about object (default returns classname())

virtual real evaluate (const Vec &output, const Vec &target) const
 returns K(x1,x2)


Static Protected Member Functions

void declareOptions (OptionList &ol)
 recognized option is "targetindex"


Protected Attributes

int targetindex
 index in target vector of the target value to use to compute the squared error (if -1, sum all the squared errors)

bool classification
real hotvalue
real coldvalue

Private Types

typedef Kernel inherited

Detailed Description

********************************************************* The following 'kernels' are rather used as cost functions

Definition at line 55 of file SquaredErrorCostFunction.h.


Member Typedef Documentation

typedef Kernel PLearn::SquaredErrorCostFunction::inherited [private]
 

Reimplemented from PLearn::Kernel.

Definition at line 57 of file SquaredErrorCostFunction.h.


Constructor & Destructor Documentation

PLearn::SquaredErrorCostFunction::SquaredErrorCostFunction int  the_targetindex = -1  )  [inline]
 

Definition at line 67 of file SquaredErrorCostFunction.h.

References classification, coldvalue, hotvalue, and targetindex.

PLearn::SquaredErrorCostFunction::SquaredErrorCostFunction real  hot_value,
real  cold_value
[inline]
 

Constructor for classification (target is interpreted as onehot).

Definition at line 71 of file SquaredErrorCostFunction.h.

References classification, coldvalue, hotvalue, and targetindex.


Member Function Documentation

void PLearn::SquaredErrorCostFunction::declareOptions OptionList ol  )  [static, protected]
 

recognized option is "targetindex"

Reimplemented from PLearn::Kernel.

Definition at line 83 of file SquaredErrorCostFunction.cc.

References PLearn::declareOption(), and PLearn::OptionList.

real PLearn::SquaredErrorCostFunction::evaluate const Vec output,
const Vec target
const [virtual]
 

returns K(x1,x2)

Implements PLearn::Kernel.

Definition at line 52 of file SquaredErrorCostFunction.cc.

References classification, coldvalue, PLearn::TVec< T >::data(), hotvalue, PLearn::TVec< T >::length(), PLERROR, PLearn::square(), targetindex, and PLearn::Vec.

virtual string PLearn::SquaredErrorCostFunction::info  )  const [inline, virtual]
 

returns a bit more informative string about object (default returns classname())

Reimplemented from PLearn::Object.

Definition at line 76 of file SquaredErrorCostFunction.h.

PLearn::SquaredErrorCostFunction::PLEARN_DECLARE_OBJECT SquaredErrorCostFunction   ) 
 


Member Data Documentation

bool PLearn::SquaredErrorCostFunction::classification [protected]
 

Definition at line 63 of file SquaredErrorCostFunction.h.

Referenced by evaluate(), and SquaredErrorCostFunction().

real PLearn::SquaredErrorCostFunction::coldvalue [protected]
 

Definition at line 64 of file SquaredErrorCostFunction.h.

Referenced by evaluate(), and SquaredErrorCostFunction().

real PLearn::SquaredErrorCostFunction::hotvalue [protected]
 

Definition at line 64 of file SquaredErrorCostFunction.h.

Referenced by evaluate(), and SquaredErrorCostFunction().

int PLearn::SquaredErrorCostFunction::targetindex [protected]
 

index in target vector of the target value to use to compute the squared error (if -1, sum all the squared errors)

Definition at line 62 of file SquaredErrorCostFunction.h.

Referenced by evaluate(), and SquaredErrorCostFunction().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:23:47 2004 for PLearn by doxygen 1.3.7