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

#include <Isomap.h>

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

List of all members.

Public Member Functions

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

Ker distance_kernel
string geodesic_file
string geodesic_method
int knn

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Private Types

typedef KernelPCA inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 53 of file Isomap.h.


Member Typedef Documentation

Reimplemented from PLearn::KernelPCA.

Definition at line 58 of file Isomap.h.


Constructor & Destructor Documentation

PLearn::Isomap::Isomap ( )

Default constructor.

Definition at line 53 of file Isomap.cc.

References distance_kernel, PLearn::KernelPCA::kernel_is_distance, and PLearn::KernelProjection::min_eigenvalue.

    : geodesic_file(""),
      geodesic_method("dijkstra"),
      knn(10)
{
    kernel_is_distance = true;
    // Default distance kernel is the classical Euclidean distance.
    distance_kernel = new DistanceKernel(2);
    min_eigenvalue = 0;
}

Member Function Documentation

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

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

Reimplemented from PLearn::KernelPCA.

Definition at line 117 of file Isomap.cc.

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

Referenced by PLearn::IsomapTangentLearner::build_().

Here is the call graph for this function:

Here is the caller graph for this function:

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

This does the actual building.

Reimplemented from PLearn::KernelPCA.

Definition at line 126 of file Isomap.cc.

References PLearn::KernelPCA::build(), distance_kernel, geodesic_file, geodesic_method, knn, PLearn::KernelPCA::kpca_kernel, PLearn::PLearner::report_progress, and PLearn::Kernel::report_progress.

Referenced by build().

{
    // Obtain the "real" KPCA kernel by computing the geodesic distances from
    // the 'distance_kernel'.
    // We have to do this iff:
    // 1. A 'distance_kernel' is provided, and
    // 2. either:
    //    2.a. the 'kpca_kernel' field is not set, or
    //    2.b. the 'kpca_kernel' field is not a GeodesicDistanceKernel acting on 'distance_kernel'.
    // This is to ensure that a loaded 'kpca_kernel' won't be overwritten.
    if (distance_kernel &&
        (!kpca_kernel ||
         (dynamic_cast<GeodesicDistanceKernel*>((Kernel*) kpca_kernel))->distance_kernel != distance_kernel)) {
        this->kpca_kernel = new GeodesicDistanceKernel(distance_kernel, knn, geodesic_file, true, geodesic_method);
        // We have modified the KPCA kernel, we must rebuild the KPCA.
        inherited::build();
    }
    if (kpca_kernel)
        kpca_kernel->report_progress = report_progress;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Declares this class' options.

Reimplemented from PLearn::KernelPCA.

Definition at line 77 of file Isomap.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::KernelPCA::declareOptions(), distance_kernel, geodesic_file, geodesic_method, PLearn::KernelPCA::kernel_is_distance, knn, PLearn::KernelPCA::kpca_kernel, PLearn::OptionBase::learntoption, PLearn::OptionBase::nosave, and PLearn::redeclareOption().

{
    // ### Declare all of this object's options here
    // ### For the "flags" of each option, you should typically specify  
    // ### one of OptionBase::buildoption, OptionBase::learntoption or 
    // ### OptionBase::tuningoption. Another possible flag to be combined with
    // ### is OptionBase::nosave

    // declareOption(ol, "myoption", &Isomap::myoption, OptionBase::buildoption,
    //               "Help text describing this option");
    // ...

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

    declareOption(ol, "distance_kernel", &Isomap::distance_kernel, OptionBase::buildoption,
                  "The kernel used to compute the input space distances.");

    declareOption(ol, "geodesic_file", &Isomap::geodesic_file, OptionBase::buildoption,
                  "If provided, the geodesic distances will be saved in this file in binary format.");

    declareOption(ol, "geodesic_method", &Isomap::geodesic_method, OptionBase::buildoption,
                  "'floyd' or 'djikstra': the method to compute the geodesic distances."
                  "(cf. GeodesicDistanceKernel)");

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

    // Modify some options from KernelPCA so as to hide them.
    redeclareOption(ol, "kernel_is_distance", &Isomap::kernel_is_distance, OptionBase::nosave,
                    "In ISOMAP, the kernel is always a distance");

    redeclareOption(ol, "kernel", &Isomap::kpca_kernel, OptionBase::learntoption,
                    "The underlying KPCA kernel is now obtained from 'distance_kernel'.");

}

Here is the call graph for this function:

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

Reimplemented from PLearn::KernelPCA.

Definition at line 121 of file Isomap.h.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

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

Reimplemented from PLearn::KernelPCA.

Definition at line 150 of file Isomap.cc.

References PLearn::KernelPCA::forget().

Here is the call graph for this function:

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Reimplemented from PLearn::KernelPCA.

Definition at line 72 of file Isomap.cc.

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::KernelPCA.

Definition at line 158 of file Isomap.cc.

References PLearn::deepCopyField(), distance_kernel, and PLearn::KernelPCA::makeDeepCopyFromShallowCopy().

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::KernelPCA.

Definition at line 121 of file Isomap.h.

Definition at line 75 of file Isomap.h.

Referenced by build_(), declareOptions(), Isomap(), and makeDeepCopyFromShallowCopy().

Definition at line 76 of file Isomap.h.

Referenced by build_(), and declareOptions().

Definition at line 77 of file Isomap.h.

Referenced by build_(), and declareOptions().

Definition at line 78 of file Isomap.h.

Referenced by build_(), PLearn::IsomapTangentLearner::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