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::KernelPCA Class Reference

#include <KernelPCA.h>

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

List of all members.

Public Member Functions

 KernelPCA ()
 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 KernelPCAdeepCopy (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 kpca_kernel
bool kernel_is_distance
bool remove_bias
bool remove_bias_in_evaluate

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Private Types

typedef KernelProjection inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Definition at line 52 of file KernelPCA.h.


Member Typedef Documentation

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 57 of file KernelPCA.h.


Constructor & Destructor Documentation

PLearn::KernelPCA::KernelPCA ( )

Default constructor.

Definition at line 52 of file KernelPCA.cc.

References PLearn::KernelProjection::min_eigenvalue.

    : kernel_is_distance(false),
      remove_bias(false),
      remove_bias_in_evaluate(false)
{
    // Usually, one will want only positive eigenvalues.
    min_eigenvalue = 0;
}

Member Function Documentation

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 103 of file KernelPCA.cc.

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

Referenced by PLearn::Isomap::build(), PLearn::Isomap::build_(), and PLearn::KPCATangentLearner::train().

Here is the call graph for this function:

Here is the caller graph for this function:

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

This does the actual building.

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 112 of file KernelPCA.cc.

References PLearn::KernelProjection::kernel, kernel_is_distance, kpca_kernel, remove_bias, and remove_bias_in_evaluate.

Referenced by build().

{
    // Obtain the "real" kernel by additive normalization of 'kpca_kernel'.
    // We have to do this iff:
    // 1. A 'kpca_kernel' is provided, and
    // 2. either:
    //    2.a. the 'kernel' option is not set, or
    //    2.b. the 'kernel' option is not an AdditiveNormalization acting on 'kpca_kernel'.
    // This is to ensure that a loaded 'kernel' won't be overwritten.
    if (kpca_kernel &&
        (!kernel ||
         (dynamic_cast<AdditiveNormalizationKernel*>((Kernel*) kernel))->source_kernel != kpca_kernel)) {
        this->kernel = new AdditiveNormalizationKernel
            (kpca_kernel, remove_bias, remove_bias_in_evaluate, kernel_is_distance);
    }
}

Here is the caller graph for this function:

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Declares this class' options.

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 70 of file KernelPCA.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::KernelProjection::declareOptions(), PLearn::KernelProjection::ignore_n_first, PLearn::KernelProjection::kernel, kernel_is_distance, kpca_kernel, PLearn::OptionBase::learntoption, PLearn::OptionBase::nosave, PLearn::redeclareOption(), remove_bias, and remove_bias_in_evaluate.

Referenced by PLearn::Isomap::declareOptions().

{
    declareOption(ol, "kernel_is_distance", &KernelPCA::kernel_is_distance, OptionBase::buildoption,
                  "If set to 1, then the kernel will be considered as a squared distance instead of\n"
                  "a dot product (i.e. the double-centering formula will be applied).");

    declareOption(ol, "remove_bias", &KernelPCA::remove_bias, OptionBase::buildoption,
                  "If set to 1, the (additively) normalized kernel will not take into account terms\n"
                  "of the form K(x_i,x_i), in order to remove bias induced by those terms.");

    declareOption(ol, "remove_bias_in_evaluate", &KernelPCA::remove_bias_in_evaluate, OptionBase::buildoption,
                  "If set to 1, the (additively) normalized kernel will not take into account terms\n"
                  "of the form K(x_i,x_i), but only when evaluated on test points.");

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

    // Redirect the 'kernel' option toward kpca_kernel.
    redeclareOption(ol, "kernel", &KernelPCA::kpca_kernel, OptionBase::buildoption,
                    "The kernel used to (implicitly) project the data in feature space.");
  
    redeclareOption(ol, "ignore_n_first", &KernelPCA::ignore_n_first, OptionBase::nosave,
                    "In KernelPCA, no eigenvector is ignored.");

    // And declare the normalized kernel so that it can be saved.
    declareOption(ol, "normalized_kernel", &KernelProjection::kernel, OptionBase::learntoption,
                  "The normalized kernel.");

}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 111 of file KernelPCA.h.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 132 of file KernelPCA.cc.

References PLearn::KernelProjection::forget().

Referenced by PLearn::Isomap::forget().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 65 of file KernelPCA.cc.

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 140 of file KernelPCA.cc.

References PLearn::deepCopyField(), kpca_kernel, and PLearn::KernelProjection::makeDeepCopyFromShallowCopy().

Referenced by PLearn::Isomap::makeDeepCopyFromShallowCopy().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from PLearn::KernelProjection.

Reimplemented in PLearn::Isomap.

Definition at line 111 of file KernelPCA.h.

Definition at line 73 of file KernelPCA.h.

Referenced by build_(), and declareOptions().

Definition at line 74 of file KernelPCA.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