PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Private Types
PLearn::SelectedOutputCostFunction Class Reference

This allows to apply a costfunction on a single output element (and correponding target element) of a larger output vector, rather than on the whole vector. More...

#include <SelectedOutputCostFunction.h>

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

List of all members.

Public Member Functions

 SelectedOutputCostFunction ()
 SelectedOutputCostFunction (Ker the_costfunc, int the_outputindex)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual
SelectedOutputCostFunction
deepCopy (CopiesMap &copies) const
virtual string info () const
 Returns a bit more informative string about object (default returns classname())
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.
virtual real evaluate (const Vec &output, const Vec &target) const
 ** Subclasses must override this method **

Static Public Member Functions

static string _classname_ ()
static OptionList_getOptionList_ ()
static RemoteMethodMap_getRemoteMethodMap_ ()
static Object_new_instance_for_typemap_ ()
static bool _isa_ (const Object *o)
static void _static_initialize_ ()
static const PPathdeclaringFile ()

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 recognized option are "outputindex" and "costfunc"

Protected Attributes

Ker costfunc
int outputindex

Private Types

typedef Kernel inherited

Detailed Description

This allows to apply a costfunction on a single output element (and correponding target element) of a larger output vector, rather than on the whole vector.

Definition at line 56 of file SelectedOutputCostFunction.h.


Member Typedef Documentation

Reimplemented from PLearn::Kernel.

Definition at line 58 of file SelectedOutputCostFunction.h.


Constructor & Destructor Documentation

PLearn::SelectedOutputCostFunction::SelectedOutputCostFunction ( ) [inline]

Definition at line 65 of file SelectedOutputCostFunction.h.

PLearn::SelectedOutputCostFunction::SelectedOutputCostFunction ( Ker  the_costfunc,
int  the_outputindex 
) [inline]

Definition at line 66 of file SelectedOutputCostFunction.h.

        : costfunc(the_costfunc), outputindex(the_outputindex) {}

Member Function Documentation

string PLearn::SelectedOutputCostFunction::_classname_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 50 of file SelectedOutputCostFunction.cc.

OptionList & PLearn::SelectedOutputCostFunction::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 50 of file SelectedOutputCostFunction.cc.

RemoteMethodMap & PLearn::SelectedOutputCostFunction::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 50 of file SelectedOutputCostFunction.cc.

bool PLearn::SelectedOutputCostFunction::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Kernel.

Definition at line 50 of file SelectedOutputCostFunction.cc.

Object * PLearn::SelectedOutputCostFunction::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 50 of file SelectedOutputCostFunction.cc.

StaticInitializer SelectedOutputCostFunction::_static_initializer_ & PLearn::SelectedOutputCostFunction::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 50 of file SelectedOutputCostFunction.cc.

string PLearn::SelectedOutputCostFunction::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 50 of file SelectedOutputCostFunction.cc.

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

recognized option are "outputindex" and "costfunc"

Reimplemented from PLearn::Kernel.

Definition at line 61 of file SelectedOutputCostFunction.cc.

References PLearn::OptionBase::buildoption, costfunc, PLearn::declareOption(), and outputindex.

Here is the call graph for this function:

static const PPath& PLearn::SelectedOutputCostFunction::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Kernel.

Definition at line 69 of file SelectedOutputCostFunction.h.

{ return "selected_output[" + tostring(outputindex) + "] "+costfunc->info(); }
SelectedOutputCostFunction * PLearn::SelectedOutputCostFunction::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Kernel.

Definition at line 50 of file SelectedOutputCostFunction.cc.

real PLearn::SelectedOutputCostFunction::evaluate ( const Vec x1,
const Vec x2 
) const [virtual]

** Subclasses must override this method **

returns K(x1,x2)

Implements PLearn::Kernel.

Definition at line 58 of file SelectedOutputCostFunction.cc.

References PLearn::TVec< T >::subVec().

{ return costfunc(output.subVec(outputindex,1),target.subVec(outputindex,1)); }

Here is the call graph for this function:

OptionList & PLearn::SelectedOutputCostFunction::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 50 of file SelectedOutputCostFunction.cc.

OptionMap & PLearn::SelectedOutputCostFunction::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 50 of file SelectedOutputCostFunction.cc.

RemoteMethodMap & PLearn::SelectedOutputCostFunction::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 50 of file SelectedOutputCostFunction.cc.

virtual string PLearn::SelectedOutputCostFunction::info ( ) const [inline, virtual]

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

Returns:
Information about the object

Reimplemented from PLearn::Object.

Definition at line 71 of file SelectedOutputCostFunction.h.

References PLearn::tostring().

    { return "selected_output[" + tostring(outputindex) + "] "+costfunc->info(); }

Here is the call graph for this function:

void PLearn::SelectedOutputCostFunction::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.

This needs to be overridden by every class that adds "complex" data members to the class, such as Vec, Mat, PP<Something>, etc. Typical implementation:

  void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies)
  {
      inherited::makeDeepCopyFromShallowCopy(copies);
      deepCopyField(complex_data_member1, copies);
      deepCopyField(complex_data_member2, copies);
      ...
  }
Parameters:
copiesA map used by the deep-copy mechanism to keep track of already-copied objects.

Reimplemented from PLearn::Kernel.

Definition at line 52 of file SelectedOutputCostFunction.cc.

References PLearn::deepCopyField().

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::Kernel.

Definition at line 69 of file SelectedOutputCostFunction.h.

Definition at line 61 of file SelectedOutputCostFunction.h.

Referenced by declareOptions().

Definition at line 62 of file SelectedOutputCostFunction.h.

Referenced by declareOptions().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines