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

PLearn::WeightedCostFunction Class Reference

A costfunction that allows to reweight another costfunction (weight being last element of target) Returns target.lastElement() * costfunc(output,target.subVec(0,target.length()-1));. More...

#include <WeightedCostFunction.h>

Inheritance diagram for PLearn::WeightedCostFunction:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
virtual real evaluate (const Vec &output, const Vec &target) const
 returns K(x1,x2)


Static Protected Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Protected Attributes

Ker costfunc

Private Types

typedef Kernel inherited

Detailed Description

A costfunction that allows to reweight another costfunction (weight being last element of target) Returns target.lastElement() * costfunc(output,target.subVec(0,target.length()-1));.

Definition at line 55 of file WeightedCostFunction.h.


Member Typedef Documentation

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

Reimplemented from PLearn::Kernel.

Definition at line 57 of file WeightedCostFunction.h.


Constructor & Destructor Documentation

PLearn::WeightedCostFunction::WeightedCostFunction  )  [inline]
 

Definition at line 63 of file WeightedCostFunction.h.

References costfunc.

PLearn::WeightedCostFunction::WeightedCostFunction Ker  the_costfunc  )  [inline]
 

Definition at line 64 of file WeightedCostFunction.h.

References costfunc.


Member Function Documentation

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

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::Kernel.

Definition at line 61 of file WeightedCostFunction.cc.

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

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

returns K(x1,x2)

Implements PLearn::Kernel.

Definition at line 57 of file WeightedCostFunction.cc.

References costfunc, PLearn::TVec< T >::length(), PLearn::TVec< T >::subVec(), and PLearn::Vec.

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

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

Reimplemented from PLearn::Object.

Definition at line 69 of file WeightedCostFunction.h.

References costfunc.

void PLearn::WeightedCostFunction::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Definition at line 51 of file WeightedCostFunction.cc.

References costfunc, and PLearn::deepCopyField().

PLearn::WeightedCostFunction::PLEARN_DECLARE_OBJECT WeightedCostFunction   ) 
 


Member Data Documentation

Ker PLearn::WeightedCostFunction::costfunc [protected]
 

Definition at line 60 of file WeightedCostFunction.h.

Referenced by evaluate(), info(), makeDeepCopyFromShallowCopy(), and WeightedCostFunction().


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