PLearn 0.1
|
#include <CenteredVMatrix.h>
Public Member Functions | |
CenteredVMatrix () | |
Default constructor. | |
CenteredVMatrix (VMat the_source) | |
Constructed from an existing source matrix. | |
Vec | getMu () const |
Return the mean sample mu. | |
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 CenteredVMatrix * | deepCopy (CopiesMap &copies) const |
Static Public Member Functions | |
static string | _classname_ () |
Declares name and deepCopy methods. | |
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 () |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Protected Member Functions | |
virtual void | getNewRow (int i, const Vec &v) const |
This is the only method requiring implementation. | |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Protected Attributes | |
Vec | mu |
The sample mean. | |
Private Types | |
typedef SourceVMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 52 of file CenteredVMatrix.h.
typedef SourceVMatrix PLearn::CenteredVMatrix::inherited [private] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 57 of file CenteredVMatrix.h.
PLearn::CenteredVMatrix::CenteredVMatrix | ( | ) |
PLearn::CenteredVMatrix::CenteredVMatrix | ( | VMat | the_source | ) |
Constructed from an existing source matrix.
Definition at line 58 of file CenteredVMatrix.cc.
string PLearn::CenteredVMatrix::_classname_ | ( | ) | [static] |
Declares name and deepCopy methods.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
OptionList & PLearn::CenteredVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
RemoteMethodMap & PLearn::CenteredVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
Object * PLearn::CenteredVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
StaticInitializer CenteredVMatrix::_static_initializer_ & PLearn::CenteredVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
void PLearn::CenteredVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::SourceVMatrix.
Definition at line 90 of file CenteredVMatrix.cc.
{ // ### Nothing to add here, simply calls build_ inherited::build(); build_(); }
void PLearn::CenteredVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 100 of file CenteredVMatrix.cc.
References PLearn::computeMean().
{ // ### This method should do the real building of the object, // ### according to set 'options', in *any* situation. // ### Typical situations include: // ### - Initial building of an object from a few user-specified options // ### - Building of a "reloaded" object: i.e. from the complete set of all serialised options. // ### - Updating or "re-building" of an object after a few "tuning" options have been modified. // ### You should assume that the parent class' build_() has already been called. if (source) { // Compute the mean. computeMean(source, mu); setMetaInfoFromSource(); } }
string PLearn::CenteredVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
void PLearn::CenteredVMatrix::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 71 of file CenteredVMatrix.cc.
References PLearn::declareOption(), mu, and PLearn::OptionBase::nosave.
{ // ### 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 // There is no need to save 'mu' since it is recomputed at build time. declareOption(ol, "mu", &CenteredVMatrix::mu, OptionBase::nosave, "The sample mean"); // Now call the parent class' declareOptions inherited::declareOptions(ol); }
static const PPath& PLearn::CenteredVMatrix::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 116 of file CenteredVMatrix.h.
CenteredVMatrix * PLearn::CenteredVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
Vec PLearn::CenteredVMatrix::getMu | ( | ) | const |
Return the mean sample mu.
Definition at line 120 of file CenteredVMatrix.cc.
Referenced by PLearn::PCA::em_algo(), and PLearn::PCA::em_orth_algo().
{ return mu; }
This is the only method requiring implementation.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 127 of file CenteredVMatrix.cc.
OptionList & PLearn::CenteredVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
OptionMap & PLearn::CenteredVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
RemoteMethodMap & PLearn::CenteredVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file CenteredVMatrix.cc.
void PLearn::CenteredVMatrix::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 136 of file CenteredVMatrix.cc.
References 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("CenteredVMatrix::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!"); }
Reimplemented from PLearn::SourceVMatrix.
Definition at line 116 of file CenteredVMatrix.h.
Vec PLearn::CenteredVMatrix::mu [protected] |