|
PLearn 0.1
|
#include <LLE.h>


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 OptionList & | getOptionList () const |
| virtual OptionMap & | getOptionMap () const |
| virtual RemoteMethodMap & | getRemoteMethodMap () const |
| virtual LLE * | 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 | |
| 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< LLEKernel > | lle_kernel |
Private Types | |
| typedef KernelProjection | inherited |
Private Member Functions | |
| void | build_ () |
| This does the actual building. | |
typedef KernelProjection PLearn::LLE::inherited [private] |
Reimplemented from PLearn::KernelProjection.
| 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. }
| string PLearn::LLE::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::KernelProjection.
| OptionList & PLearn::LLE::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::KernelProjection.
| RemoteMethodMap & PLearn::LLE::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::KernelProjection.
Reimplemented from PLearn::KernelProjection.
| Object * PLearn::LLE::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::KernelProjection.
| StaticInitializer LLE::_static_initializer_ & PLearn::LLE::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::KernelProjection.
| 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_().
{
inherited::build();
build_();
}

| 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;
}

| string PLearn::LLE::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelProjection.
| 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.");
}

| static const PPath& PLearn::LLE::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::KernelProjection.
Reimplemented from PLearn::KernelProjection.
| 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().
{
inherited::forget();
}

| OptionList & PLearn::LLE::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelProjection.
| OptionMap & PLearn::LLE::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelProjection.
| RemoteMethodMap & PLearn::LLE::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelProjection.
| 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!");
}

Reimplemented from PLearn::KernelProjection.
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().
PP<LLEKernel> PLearn::LLE::lle_kernel [protected] |
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().
1.7.4