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

#include <LLE.h>

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

List of all members.

Public Member Functions

 LLE ()
 Default constructor.
virtual void build ()
 Simply calls inherited::build() then build_().
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual LLEdeepCopy (CopiesMap &copies) const
virtual void forget ()
 (Re-)initializes the PLearner in its fresh state.

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

bool classical_induction
int knn
real reconstruct_coeff
real regularizer

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Protected Attributes

PP< LLEKernellle_kernel

Private Types

typedef KernelProjection inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 53 of file LLE.h.


Member Typedef Documentation

Reimplemented from PLearn::KernelProjection.

Definition at line 58 of file LLE.h.


Constructor & Destructor Documentation

PLearn::LLE::LLE ( )

Default constructor.

Definition at line 52 of file LLE.cc.

References PLearn::KernelProjection::ignore_n_first, lle_kernel, and PLearn::KernelProjection::normalize.

    : classical_induction(true),
      knn(5),
      reconstruct_coeff(-1),
      regularizer(1e-6)
{
    lle_kernel = new LLEKernel();
    this->normalize = "unit_var";  // In LLE, we normalize.
    this->ignore_n_first = 1; // In LLE, we ignore the first eigenvector.
}

Member Function Documentation

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

void PLearn::LLE::build ( ) [virtual]

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

Reimplemented from PLearn::KernelProjection.

Definition at line 111 of file LLE.cc.

References PLearn::KernelProjection::build(), and build_().

Here is the call graph for this function:

void PLearn::LLE::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::KernelProjection.

Definition at line 120 of file LLE.cc.

References classical_induction, PLearn::KernelProjection::kernel, knn, lle_kernel, PLearn::KernelProjection::normalize, reconstruct_coeff, regularizer, and PLearn::PLearner::report_progress.

Referenced by build().

{
    if (classical_induction) {
        lle_kernel->reconstruct_coeff = -1;
        normalize = "unit_eigen";
    } else {
        lle_kernel->reconstruct_coeff = this->reconstruct_coeff;
        normalize = "unit_var";
    }
    lle_kernel->knn = this->knn;
    lle_kernel->regularizer = this->regularizer;
    lle_kernel->report_progress = this->report_progress;
    lle_kernel->build();
    this->kernel = (Kernel*) lle_kernel;
}

Here is the caller graph for this function:

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Declares this class' options.

Reimplemented from PLearn::KernelProjection.

Definition at line 71 of file LLE.cc.

References PLearn::OptionBase::buildoption, classical_induction, PLearn::declareOption(), PLearn::KernelProjection::declareOptions(), PLearn::KernelProjection::ignore_n_first, PLearn::KernelProjection::kernel, knn, PLearn::OptionBase::learntoption, lle_kernel, PLearn::KernelProjection::normalize, PLearn::OptionBase::nosave, reconstruct_coeff, PLearn::redeclareOption(), and regularizer.

{
    // Build options.

    declareOption(ol, "knn", &LLE::knn, OptionBase::buildoption,
                  "The number of nearest neighbors considered.");

    declareOption(ol, "classical_induction", &LLE::classical_induction, OptionBase::buildoption,
                  "If set to 1, then the out-of-sample extension of LLE will be the classical\n"
                  "one, corresponding to an infinite 'reconstruct_coeff' (whose value is ignored).");

    declareOption(ol, "reconstruct_coeff", &LLE::reconstruct_coeff, OptionBase::buildoption,
                  "The weight of K' in the weighted sum of K' and K'' (see LLEKernel).");

    declareOption(ol, "regularizer", &LLE::regularizer, OptionBase::buildoption,
                  "The regularization factor used to make the linear systems stable.");

    // Learnt options.

    declareOption(ol, "lle_kernel", &LLE::lle_kernel, OptionBase::learntoption,
                  "The kernel used in LLE.");

    // Now call the parent class' declareOptions.
    inherited::declareOptions(ol);

    // Hide unused options from KernelProjection.
    redeclareOption(ol, "kernel", &LLE::kernel, OptionBase::nosave,
                    "Will be set at build time.");

    redeclareOption(ol, "normalize", &LLE::normalize, OptionBase::nosave,
                    "Will be set at construction and build time.");

    redeclareOption(ol, "ignore_n_first", &LLE::ignore_n_first, OptionBase::nosave,
                    "Will be set to 1 at construction time.");

}

Here is the call graph for this function:

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

Reimplemented from PLearn::KernelProjection.

Definition at line 114 of file LLE.h.

LLE * PLearn::LLE::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

void PLearn::LLE::forget ( ) [virtual]

(Re-)initializes the PLearner in its fresh state.

Reimplemented from PLearn::KernelProjection.

Definition at line 139 of file LLE.cc.

References PLearn::KernelProjection::forget().

Here is the call graph for this function:

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Reimplemented from PLearn::KernelProjection.

Definition at line 66 of file LLE.cc.

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::KernelProjection.

Definition at line 147 of file LLE.cc.

References PLearn::KernelProjection::makeDeepCopyFromShallowCopy(), and PLERROR.

{
    inherited::makeDeepCopyFromShallowCopy(copies);

    // ### Call deepCopyField on all "pointer-like" fields 
    // ### that you wish to be deepCopied rather than 
    // ### shallow-copied.
    // ### ex:
    // deepCopyField(trainvec, copies);

    // ### Remove this line when you have fully implemented this method.
    PLERROR("LLE::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::KernelProjection.

Definition at line 114 of file LLE.h.

Definition at line 74 of file LLE.h.

Referenced by build_(), and declareOptions().

Definition at line 75 of file LLE.h.

Referenced by build_(), and declareOptions().

Definition at line 66 of file LLE.h.

Referenced by build_(), declareOptions(), and LLE().

Definition at line 76 of file LLE.h.

Referenced by build_(), and declareOptions().

Definition at line 77 of file LLE.h.

Referenced by build_(), and declareOptions().


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