PLearn 0.1
|
#include <Isomap.h>
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 OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual Isomap * | 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 | 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. |
typedef KernelPCA PLearn::Isomap::inherited [private] |
Reimplemented from PLearn::KernelPCA.
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; }
string PLearn::Isomap::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::KernelPCA.
OptionList & PLearn::Isomap::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::KernelPCA.
RemoteMethodMap & PLearn::Isomap::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::KernelPCA.
Reimplemented from PLearn::KernelPCA.
Object * PLearn::Isomap::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::KernelPCA.
StaticInitializer Isomap::_static_initializer_ & PLearn::Isomap::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::KernelPCA.
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_().
{ inherited::build(); build_(); }
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; }
string PLearn::Isomap::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelPCA.
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'."); }
static const PPath& PLearn::Isomap::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::KernelPCA.
Reimplemented from PLearn::KernelPCA.
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().
{ inherited::forget(); }
OptionList & PLearn::Isomap::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelPCA.
OptionMap & PLearn::Isomap::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelPCA.
RemoteMethodMap & PLearn::Isomap::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::KernelPCA.
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().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(distance_kernel, copies); }
Reimplemented from PLearn::KernelPCA.
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().