PLearn 0.1
|
#include <KernelPCA.h>
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 OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual KernelPCA * | deepCopy (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 PPath & | declaringFile () |
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. |
Definition at line 52 of file KernelPCA.h.
typedef KernelProjection PLearn::KernelPCA::inherited [private] |
Reimplemented from PLearn::KernelProjection.
Reimplemented in PLearn::Isomap.
Definition at line 57 of file KernelPCA.h.
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; }
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.
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().
{ inherited::build(); build_(); }
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); } }
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."); }
static const PPath& PLearn::KernelPCA::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::KernelProjection.
Reimplemented in PLearn::Isomap.
Definition at line 111 of file KernelPCA.h.
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().
{ inherited::forget(); }
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().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(kpca_kernel, copies); }
Reimplemented from PLearn::KernelProjection.
Reimplemented in PLearn::Isomap.
Definition at line 111 of file KernelPCA.h.
Definition at line 72 of file KernelPCA.h.
Referenced by build_(), PLearn::Isomap::declareOptions(), declareOptions(), and PLearn::Isomap::Isomap().
Definition at line 71 of file KernelPCA.h.
Referenced by PLearn::Isomap::build_(), build_(), PLearn::Isomap::declareOptions(), declareOptions(), makeDeepCopyFromShallowCopy(), and PLearn::KPCATangentLearner::train().
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().