#include <LLEKernel.h>
Inheritance diagram for PLearn::LLEKernel:
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< ReconstructionWeightsKernel > | reconstruct_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. |
|
Reimplemented from PLearn::Kernel. Definition at line 58 of file LLEKernel.h. |
|
Default constructor.
Definition at line 52 of file LLEKernel.cc. |
|
Simply calls inherited::build() then build_().
Reimplemented from PLearn::Kernel. Definition at line 103 of file LLEKernel.cc. References build_(), and build_in_progress. |
|
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(). |
|
Overridden for efficiency purpose.
Reimplemented from PLearn::Kernel. Definition at line 139 of file LLEKernel.cc. References PLearn::Mat, reconstruct_coeff, and reconstruct_ker. |
|
Declares this class' options.
Reimplemented from PLearn::Kernel. Definition at line 82 of file LLEKernel.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
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. |
|
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(). |
|
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(). |
|
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(). |
|
Transforms a shallow copy into a deep copy.
Definition at line 235 of file LLEKernel.cc. References PLERROR. |
|
|
|
** 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_(). |
|
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(). |
|
Definition at line 88 of file LLEKernel.h. Referenced by build_(). |
|
Definition at line 89 of file LLEKernel.h. Referenced by build_(), computeGramMatrix(), evaluate_i_j(), and evaluate_i_x_again(). |
|
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(). |
|
Definition at line 90 of file LLEKernel.h. Referenced by build_(). |
|
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(). |
|
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(). |