PLearn 0.1
|
#include <GramVMatrix.h>
Public Member Functions | |
GramVMatrix () | |
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 GramVMatrix * | deepCopy (CopiesMap &copies) const |
Static Public Member Functions | |
static string | _classname_ () |
MemoryVMatrix. | |
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 | kernel |
int | verbosity |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Private Types | |
typedef MemoryVMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 53 of file GramVMatrix.h.
typedef MemoryVMatrix PLearn::GramVMatrix::inherited [private] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 58 of file GramVMatrix.h.
PLearn::GramVMatrix::GramVMatrix | ( | ) |
string PLearn::GramVMatrix::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
OptionList & PLearn::GramVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
RemoteMethodMap & PLearn::GramVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
Object * PLearn::GramVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
StaticInitializer GramVMatrix::_static_initializer_ & PLearn::GramVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
void PLearn::GramVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_()
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 100 of file GramVMatrix.cc.
References PLearn::MemoryVMatrix::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::GramVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 109 of file GramVMatrix.cc.
References PLearn::MemoryVMatrix::build(), PLearn::MemoryVMatrix::data, PLearn::endl(), kernel, PLearn::VMatrix::length_, n, PLearn::TMat< T >::resize(), PLearn::VMatrix::updateMtime(), verbosity, and PLearn::VMatrix::width_.
Referenced by build().
{ if (kernel) { updateMtime(kernel->getData()); updateMtime(kernel->specify_dataset); bool old_report_progress = kernel->report_progress != 0; if (verbosity < 1) { kernel->report_progress = false; } int n = kernel->getData()->length(); data.resize(n, n); clock_t time_for_gram = clock(); kernel->computeGramMatrix(data); time_for_gram = clock() - time_for_gram; real real_time_for_gram = real(time_for_gram) / real(CLOCKS_PER_SEC); if (verbosity >= 2) { cout << "Time to compute the Gram matrix: " << real_time_for_gram << endl; } kernel->report_progress = old_report_progress; length_ = width_ = n; inherited::build(); } }
string PLearn::GramVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
void PLearn::GramVMatrix::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 67 of file GramVMatrix.cc.
References PLearn::OptionBase::buildoption, PLearn::MemoryVMatrix::data, PLearn::declareOption(), PLearn::MemoryVMatrix::declareOptions(), kernel, PLearn::OptionBase::nosave, PLearn::redeclareOption(), PLearn::MemoryVMatrix::source, and verbosity.
{ // ### 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, "kernel", &GramVMatrix::kernel, OptionBase::buildoption, "The kernel whose Gram matrix we want to compute."); declareOption(ol, "verbosity", &GramVMatrix::verbosity, OptionBase::buildoption, "The level of verbosity."); // "Help text describing this option"); // ... // Now call the parent class' declareOptions inherited::declareOptions(ol); // Hide the 'data' and 'source' options of a MemoryVMatrix, that are // not used in this subclass. redeclareOption(ol, "data", &GramVMatrix::data, OptionBase::nosave, "Not needed here."); redeclareOption(ol, "source", &GramVMatrix::source, OptionBase::nosave, "Not needed here."); }
static const PPath& PLearn::GramVMatrix::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 111 of file GramVMatrix.h.
GramVMatrix * PLearn::GramVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
OptionList & PLearn::GramVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
OptionMap & PLearn::GramVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
RemoteMethodMap & PLearn::GramVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 62 of file GramVMatrix.cc.
void PLearn::GramVMatrix::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 136 of file GramVMatrix.cc.
References PLearn::MemoryVMatrix::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("GramVMatrix::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!"); }
Reimplemented from PLearn::MemoryVMatrix.
Definition at line 111 of file GramVMatrix.h.
Definition at line 72 of file GramVMatrix.h.
Referenced by build_(), and declareOptions().
Definition at line 73 of file GramVMatrix.h.
Referenced by build_(), and declareOptions().