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

PLearn::LLEKernel Class Reference

#include <LLEKernel.h>

Inheritance diagram for PLearn::LLEKernel:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLEKernel ()
 Default constructor.

virtual void build ()
 Simply calls inherited::build() then build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (LLEKernel)
virtual void computeGramMatrix (Mat K) const
 Overridden for efficiency purpose.

virtual real evaluate (const Vec &x1, const Vec &x2) const
 Compute K(x1,x2).

virtual real evaluate_i_j (int i, int j) const
 returns evaluate(data(i),data(j))

virtual real evaluate_i_x (int i, const Vec &x, real squared_norm_of_x=-1) const
virtual real evaluate_i_x_again (int i, const Vec &x, real squared_norm_of_x=-1, bool first_time=false) const
 Return evaluate(data(i),x), where x is the same as in the precedent call to this same function (except if 'first_time' is true).

virtual void setDataForKernelMatrix (VMat the_data)
 ** Subclasses may overload these methods to provide efficient kernel matrix access **


Public Attributes

int knn
real reconstruct_coeff
real regularizer

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Protected Attributes

PP< ReconstructionWeightsKernelreconstruct_ker
 The kernel used to compute the reconstruction weights.


Private Types

typedef Kernel inherited

Private Member Functions

void build_ ()
 This does the actual building.


Private Attributes

bool build_in_progress
 True iff build() has been called but build_() has not been called yet.

bool x_is_training_point
 Used in 'evaluate_i_x_again' to remember whether x is a training point or not.

int x_index
 Used in 'evaluate_i_x_again' to remember the index of x when it is a training point.


Member Typedef Documentation

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

Reimplemented from PLearn::Kernel.

Definition at line 58 of file LLEKernel.h.


Constructor & Destructor Documentation

PLearn::LLEKernel::LLEKernel  ) 
 

Default constructor.

Definition at line 52 of file LLEKernel.cc.


Member Function Documentation

void PLearn::LLEKernel::build  )  [virtual]
 

Simply calls inherited::build() then build_().

Reimplemented from PLearn::Kernel.

Definition at line 103 of file LLEKernel.cc.

References build_(), and build_in_progress.

void PLearn::LLEKernel::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::Kernel.

Definition at line 113 of file LLEKernel.cc.

References build_in_progress, knn, PLWARNING, reconstruct_coeff, reconstruct_ker, regularizer, and setDataForKernelMatrix().

Referenced by build().

void PLearn::LLEKernel::computeGramMatrix Mat  K  )  const [virtual]
 

Overridden for efficiency purpose.

Reimplemented from PLearn::Kernel.

Definition at line 139 of file LLEKernel.cc.

References PLearn::Mat, reconstruct_coeff, and reconstruct_ker.

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

Declares this class' options.

Reimplemented from PLearn::Kernel.

Definition at line 82 of file LLEKernel.cc.

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

real PLearn::LLEKernel::evaluate const Vec x1,
const Vec x2
const [virtual]
 

Compute K(x1,x2).

Implements PLearn::Kernel.

Definition at line 151 of file LLEKernel.cc.

References evaluate_i_j(), evaluate_i_x(), and PLearn::Vec.

real PLearn::LLEKernel::evaluate_i_j int  i,
int  j
const [virtual]
 

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

Reimplemented from PLearn::Kernel.

Definition at line 175 of file LLEKernel.cc.

References reconstruct_coeff, and reconstruct_ker.

Referenced by evaluate(), and evaluate_i_x_again().

real PLearn::LLEKernel::evaluate_i_x int  i,
const Vec x,
real  squared_norm_of_x = -1
const [virtual]
 

returns evaluate(data(i),x) [squared_norm_of_x is just a hint that may allow to speed up computation if it is already known, but it's optional]

Reimplemented from PLearn::Kernel.

Definition at line 201 of file LLEKernel.cc.

References evaluate_i_x_again(), and x.

Referenced by evaluate().

real PLearn::LLEKernel::evaluate_i_x_again int  i,
const Vec x,
real  squared_norm_of_x = -1,
bool  first_time = false
const [virtual]
 

Return evaluate(data(i),x), where x is the same as in the precedent call to this same function (except if 'first_time' is true).

This can be used to speed up successive computations of K(x_i, x) (default version just calls evaluate_i_x).

Reimplemented from PLearn::Kernel.

Definition at line 208 of file LLEKernel.cc.

References evaluate_i_j(), reconstruct_coeff, reconstruct_ker, x, x_index, and x_is_training_point.

Referenced by evaluate_i_x().

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

Transforms a shallow copy into a deep copy.

Definition at line 235 of file LLEKernel.cc.

References PLERROR.

PLearn::LLEKernel::PLEARN_DECLARE_OBJECT LLEKernel   ) 
 

void PLearn::LLEKernel::setDataForKernelMatrix VMat  the_data  )  [virtual]
 

** Subclasses may overload 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 252 of file LLEKernel.cc.

References build_in_progress, and reconstruct_ker.

Referenced by build_().


Member Data Documentation

bool PLearn::LLEKernel::build_in_progress [private]
 

True iff build() has been called but build_() has not been called yet.

Definition at line 61 of file LLEKernel.h.

Referenced by build(), build_(), and setDataForKernelMatrix().

int PLearn::LLEKernel::knn
 

Definition at line 88 of file LLEKernel.h.

Referenced by build_().

real PLearn::LLEKernel::reconstruct_coeff
 

Definition at line 89 of file LLEKernel.h.

Referenced by build_(), computeGramMatrix(), evaluate_i_j(), and evaluate_i_x_again().

PP<ReconstructionWeightsKernel> PLearn::LLEKernel::reconstruct_ker [protected]
 

The kernel used to compute the reconstruction weights.

Definition at line 80 of file LLEKernel.h.

Referenced by build_(), computeGramMatrix(), evaluate_i_j(), evaluate_i_x_again(), and setDataForKernelMatrix().

real PLearn::LLEKernel::regularizer
 

Definition at line 90 of file LLEKernel.h.

Referenced by build_().

int PLearn::LLEKernel::x_index [mutable, private]
 

Used in 'evaluate_i_x_again' to remember the index of x when it is a training point.

Definition at line 69 of file LLEKernel.h.

Referenced by evaluate_i_x_again().

bool PLearn::LLEKernel::x_is_training_point [mutable, private]
 

Used in 'evaluate_i_x_again' to remember whether x is a training point or not.

Definition at line 65 of file LLEKernel.h.

Referenced by evaluate_i_x_again().


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