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

#include <ManifoldParzenKernel.h>

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

List of all members.

Public Member Functions

 ManifoldParzenKernel ()
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual ManifoldParzenKerneldeepCopy (CopiesMap &copies) const
virtual real evaluate (const Vec &x1, const Vec &x2) const
 ** Subclasses must override this method **
virtual real evaluate_i_j (int i, int j) const
 returns evaluate(data(i),data(j))
virtual void setDataForKernelMatrix (VMat the_data)
 ** Subclasses may override these methods to provide efficient kernel matrix access **
virtual void addDataForKernelMatrix (const Vec &newRow)
 This method is meant to be used any time the data matrix is appended a new row by an outer instance (e.g.

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 ()

Public Attributes

real scale
 Scale factor on the eigen values.
PP< ManifoldParzen2mp
 ManifoldParzen2 distribution.
bool train_mp
 Indication that the ManifoldParzen distribution should be trained.

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declare options (data fields) for the class.

Private Types

typedef Kernel inherited

Detailed Description

Kernel that uses the evaluate method of Manifold Parzen.

Definition at line 56 of file ManifoldParzenKernel.h.


Member Typedef Documentation

Reimplemented from PLearn::Kernel.

Definition at line 58 of file ManifoldParzenKernel.h.


Constructor & Destructor Documentation

PLearn::ManifoldParzenKernel::ManifoldParzenKernel ( ) [inline]

Definition at line 70 of file ManifoldParzenKernel.h.

        : inherited(true),scale(1.0), mp(0), train_mp(true){}

Member Function Documentation

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

Reimplemented from PLearn::Kernel.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Reimplemented from PLearn::Object.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Reimplemented from PLearn::Kernel.

Definition at line 51 of file ManifoldParzenKernel.cc.

void PLearn::ManifoldParzenKernel::addDataForKernelMatrix ( const Vec newRow) [virtual]

This method is meant to be used any time the data matrix is appended a new row by an outer instance (e.g.

SequentialKernel). Through this method, the kernel must update any data dependent internal structure. The internal structures should have consistent length with the data matrix, assuming a sequential growing of the vmat.

Reimplemented from PLearn::Kernel.

Definition at line 102 of file ManifoldParzenKernel.cc.

References PLERROR.

{
    PLERROR("ManifoldParzenKernel::addDataForKernelMatrix: this method is currently not supported.");
  
}
string PLearn::ManifoldParzenKernel::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Declare options (data fields) for the class.

Redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options). Please call the inherited method AT THE END to get the options listed in a consistent order (from most recently defined to least recently defined).

  static void MyDerivedClass::declareOptions(OptionList& ol)
  {
      declareOption(ol, "inputsize", &MyObject::inputsize_,
                    OptionBase::buildoption,
                    "The size of the input; it must be provided");
      declareOption(ol, "weights", &MyObject::weights,
                    OptionBase::learntoption,
                    "The learned model weights");
      inherited::declareOptions(ol);
  }
Parameters:
olList of options that is progressively being constructed for the current class.

Reimplemented from PLearn::Kernel.

Definition at line 75 of file ManifoldParzenKernel.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), mp, scale, and train_mp.

{
    declareOption(ol, "scale", &ManifoldParzenKernel::scale, OptionBase::buildoption,
                  "The scale factor of the eigen values");
    declareOption(ol, "mp", &ManifoldParzenKernel::mp, OptionBase::buildoption,
                  "Manifold Parzen distribution");
    declareOption(ol, "train_mp", &ManifoldParzenKernel::train_mp, OptionBase::buildoption,
                  "Indication that the ManifoldParzen distribution should be trained");
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

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

Reimplemented from PLearn::Kernel.

Definition at line 73 of file ManifoldParzenKernel.h.

:
    static void declareOptions(OptionList& ol);
ManifoldParzenKernel * PLearn::ManifoldParzenKernel::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

** Subclasses must override this method **

returns K(x1,x2)

Implements PLearn::Kernel.

Definition at line 53 of file ManifoldParzenKernel.cc.

{ 
    real ret;
    if(is_symmetric)
        ret = mp->evaluate(x1,x2,scale) + mp->evaluate(x2,x1,scale);
    else
        ret = mp->evaluate(x1,x2,scale);
  
    return ret;
}
real PLearn::ManifoldParzenKernel::evaluate_i_j ( int  i,
int  j 
) const [virtual]

returns evaluate(data(i),data(j))

Reimplemented from PLearn::Kernel.

Definition at line 64 of file ManifoldParzenKernel.cc.

{ 
    real ret;
    if(is_symmetric)
        ret = mp->evaluate_i_j(i,j,scale) + mp->evaluate_i_j(j,i,scale);
    else
        ret = mp->evaluate_i_j(i,j,scale);
  
    return ret;
}
OptionList & PLearn::ManifoldParzenKernel::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Reimplemented from PLearn::Object.

Definition at line 51 of file ManifoldParzenKernel.cc.

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

Reimplemented from PLearn::Object.

Definition at line 51 of file ManifoldParzenKernel.cc.

void PLearn::ManifoldParzenKernel::setDataForKernelMatrix ( VMat  the_data) [virtual]

** Subclasses may override these methods to provide efficient kernel matrix access **

This method sets the data VMat that will be used to define the kernel matrix. It may precompute values from this that may later accelerate the evaluation of a kernel matrix element

Reimplemented from PLearn::Kernel.

Definition at line 86 of file ManifoldParzenKernel.cc.

References PLWARNING.

{
    inherited::setDataForKernelMatrix(the_data);
    if(train_mp && data)
    {
        mp->setTrainingSet(data);
        PP<VecStatsCollector> stats = new VecStatsCollector();
        mp->setTrainStatsCollector(stats);
        mp->train();
        stats->finalize();
    }
  
    if(!train_mp && data) PLWARNING("ManifoldParzenKernel::setDataForKernelMatrix: data of kernel is possibly different from data of ManifoldParzen distribution.");
  
}

Member Data Documentation

Reimplemented from PLearn::Kernel.

Definition at line 73 of file ManifoldParzenKernel.h.

ManifoldParzen2 distribution.

Definition at line 65 of file ManifoldParzenKernel.h.

Referenced by declareOptions().

Scale factor on the eigen values.

Definition at line 62 of file ManifoldParzenKernel.h.

Referenced by declareOptions().

Indication that the ManifoldParzen distribution should be trained.

Definition at line 68 of file ManifoldParzenKernel.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