| 
    PLearn 0.1 
   | 
 
#include <SpectralClustering.h>


Public Member Functions | |
| SpectralClustering () | |
| 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 SpectralClustering * | 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 | remove_bias | 
Static Public Attributes | |
| static StaticInitializer | _static_initializer_ | 
Static Protected Member Functions | |
| static void | declareOptions (OptionList &ol) | 
| Declares this class' options.   | |
Protected Attributes | |
| Ker | sc_kernel | 
Private Types | |
| typedef KernelProjection | inherited | 
Private Member Functions | |
| void | build_ () | 
| This does the actual building.   | |
Definition at line 52 of file SpectralClustering.h.
typedef KernelProjection PLearn::SpectralClustering::inherited [private] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 57 of file SpectralClustering.h.
| PLearn::SpectralClustering::SpectralClustering | ( | ) | 
Default constructor.
Definition at line 52 of file SpectralClustering.cc.
References PLearn::KernelProjection::min_eigenvalue.
: remove_bias(false) { // Usually, one will want only positive eigenvalues. min_eigenvalue = 0; }
| string PLearn::SpectralClustering::_classname_ | ( | ) |  [static] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| OptionList & PLearn::SpectralClustering::_getOptionList_ | ( | ) |  [static] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| RemoteMethodMap & PLearn::SpectralClustering::_getRemoteMethodMap_ | ( | ) |  [static] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| Object * PLearn::SpectralClustering::_new_instance_for_typemap_ | ( | ) |  [static] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| StaticInitializer SpectralClustering::_static_initializer_ & PLearn::SpectralClustering::_static_initialize_ | ( | ) |  [static] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| void PLearn::SpectralClustering::build | ( | ) |  [virtual] | 
        
Simply calls inherited::build() then build_().
Reimplemented from PLearn::KernelProjection.
Definition at line 92 of file SpectralClustering.cc.
References PLearn::KernelProjection::build(), and build_().
{
    inherited::build();
    build_();
}

| void PLearn::SpectralClustering::build_ | ( | ) |  [private] | 
        
This does the actual building.
Reimplemented from PLearn::KernelProjection.
Definition at line 101 of file SpectralClustering.cc.
References PLearn::KernelProjection::kernel, remove_bias, and sc_kernel.
Referenced by build().
{
    // Obtain the "real" kernel by divisive normalization of 'sc_kernel'.
    // We have to do this iff:
    // 1. A 'sc_kernel' is provided, and
    // 2. either:
    //    2.a. the 'kernel' option is not set, or
    //    2.b. the 'kernel' option is not a DivisiveNormalizationKernel acting on 'sc_kernel'.
    // This is to ensure that a loaded 'kernel' won't be overwritten.
    if (sc_kernel &&
        (!kernel ||
         (dynamic_cast<DivisiveNormalizationKernel*>((Kernel*) kernel))->source_kernel != sc_kernel)) {
        this->kernel = new DivisiveNormalizationKernel
            (sc_kernel, remove_bias);
    }
}

| string PLearn::SpectralClustering::classname | ( | ) |  const [virtual] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| void PLearn::SpectralClustering::declareOptions | ( | OptionList & | ol | ) |  [static, protected] | 
        
Declares this class' options.
Reimplemented from PLearn::KernelProjection.
Definition at line 68 of file SpectralClustering.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::KernelProjection::declareOptions(), PLearn::KernelProjection::ignore_n_first, PLearn::KernelProjection::kernel, PLearn::OptionBase::learntoption, PLearn::OptionBase::nosave, PLearn::redeclareOption(), remove_bias, and sc_kernel.
{
    declareOption(ol, "remove_bias", &SpectralClustering::remove_bias, OptionBase::buildoption,
                  "If set to 1, the (divisively) 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.");
    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
    // Redirect the 'kernel' option toward sc_kernel.
    redeclareOption(ol, "kernel", &SpectralClustering::sc_kernel, OptionBase::buildoption,
                    "The kernel used to (implicitly) project the data in feature space.");
    redeclareOption(ol, "ignore_n_first", &SpectralClustering::ignore_n_first, OptionBase::nosave,
                    "In Spectral clustering, 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::SpectralClustering::declaringFile | ( | ) |  [inline, static] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 110 of file SpectralClustering.h.
| SpectralClustering * PLearn::SpectralClustering::deepCopy | ( | CopiesMap & | copies | ) |  const [virtual] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| void PLearn::SpectralClustering::forget | ( | ) |  [virtual] | 
        
(Re-)initializes the PLearner in its fresh state.
Reimplemented from PLearn::KernelProjection.
Definition at line 121 of file SpectralClustering.cc.
References PLearn::KernelProjection::forget().
{
    inherited::forget();
}

| OptionList & PLearn::SpectralClustering::getOptionList | ( | ) |  const [virtual] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| OptionMap & PLearn::SpectralClustering::getOptionMap | ( | ) |  const [virtual] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| RemoteMethodMap & PLearn::SpectralClustering::getRemoteMethodMap | ( | ) |  const [virtual] | 
        
Reimplemented from PLearn::KernelProjection.
Definition at line 63 of file SpectralClustering.cc.
| void PLearn::SpectralClustering::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) |  [virtual] | 
        
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::KernelProjection.
Definition at line 129 of file SpectralClustering.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("SpectralClustering::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Reimplemented from PLearn::KernelProjection.
Definition at line 110 of file SpectralClustering.h.
Definition at line 73 of file SpectralClustering.h.
Referenced by build_(), and declareOptions().
Ker PLearn::SpectralClustering::sc_kernel [protected] | 
        
Definition at line 65 of file SpectralClustering.h.
Referenced by build_(), and declareOptions().
 1.7.4