PLearn 0.1
|
#include <RealFunctionsProcessedVMatrix.h>
Public Member Functions | |
RealFunctionsProcessedVMatrix (VMat source_=0, const TVec< RealFunc > &functions_=TVec< RealFunc >(), bool put_raw_input_=false, bool put_non_input_=false, bool call_build_=false) | |
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 RealFunctionsProcessedVMatrix * | 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 () |
Public Attributes | |
TVec< RealFunc > | functions |
bool | put_raw_input |
bool | put_non_input |
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 | input |
Vec | targ |
real | weight |
Private Types | |
typedef SourceVMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 49 of file RealFunctionsProcessedVMatrix.h.
typedef SourceVMatrix PLearn::RealFunctionsProcessedVMatrix::inherited [private] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 51 of file RealFunctionsProcessedVMatrix.h.
PLearn::RealFunctionsProcessedVMatrix::RealFunctionsProcessedVMatrix | ( | VMat | source_ = 0 , |
const TVec< RealFunc > & | functions_ = TVec<RealFunc>() , |
||
bool | put_raw_input_ = false , |
||
bool | put_non_input_ = false , |
||
bool | call_build_ = false |
||
) |
Definition at line 46 of file RealFunctionsProcessedVMatrix.cc.
References build_().
:inherited(source_, call_build_), functions(functions_), put_raw_input(put_raw_input_), put_non_input(put_non_input_) { if( call_build_ ) build_(); }
string PLearn::RealFunctionsProcessedVMatrix::_classname_ | ( | ) | [static] |
Declares name and deepCopy methods.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
OptionList & PLearn::RealFunctionsProcessedVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
RemoteMethodMap & PLearn::RealFunctionsProcessedVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
Object * PLearn::RealFunctionsProcessedVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
StaticInitializer RealFunctionsProcessedVMatrix::_static_initializer_ & PLearn::RealFunctionsProcessedVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
void PLearn::RealFunctionsProcessedVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::SourceVMatrix.
Definition at line 117 of file RealFunctionsProcessedVMatrix.cc.
References PLearn::SourceVMatrix::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::RealFunctionsProcessedVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 97 of file RealFunctionsProcessedVMatrix.cc.
References functions, PLearn::TVec< T >::length(), PLearn::VMat::length(), PLearn::VMatrix::length_, put_non_input, put_raw_input, PLearn::SourceVMatrix::source, PLearn::VMatrix::updateMtime(), and PLearn::VMatrix::width_.
Referenced by build(), and RealFunctionsProcessedVMatrix().
{ if(source) { updateMtime(source); length_= source->length(); if(functions) { width_= functions->length(); if(put_raw_input) width_+= source->inputsize(); if(put_non_input) width_+= source->targetsize() + source->weightsize(); } } }
string PLearn::RealFunctionsProcessedVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
void PLearn::RealFunctionsProcessedVMatrix::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 66 of file RealFunctionsProcessedVMatrix.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::SourceVMatrix::declareOptions(), functions, put_non_input, and put_raw_input.
{ // ### 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, "functions", &RealFunctionsProcessedVMatrix::functions, OptionBase::buildoption, "The functions used to process the inputs from the source VMat."); declareOption(ol, "put_raw_input", &RealFunctionsProcessedVMatrix::put_raw_input, OptionBase::buildoption, "Whether to include in the input part of this VMatrix the" " raw input part\n" "of 'source'.\n"); declareOption(ol, "put_non_input", &RealFunctionsProcessedVMatrix::put_non_input, OptionBase::buildoption, "Whether to include in this VMatrix the original target and" " weights."); // Now call the parent class' declareOptions inherited::declareOptions(ol); }
static const PPath& PLearn::RealFunctionsProcessedVMatrix::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 109 of file RealFunctionsProcessedVMatrix.h.
RealFunctionsProcessedVMatrix * PLearn::RealFunctionsProcessedVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
void PLearn::RealFunctionsProcessedVMatrix::getNewRow | ( | int | i, |
const Vec & | v | ||
) | const [protected, virtual] |
This is the only method requiring implementation.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 135 of file RealFunctionsProcessedVMatrix.cc.
References PLearn::evaluate_functions(), functions, PLearn::VMat::getExample(), input, PLearn::TVec< T >::length(), put_non_input, put_raw_input, PLearn::SourceVMatrix::source, PLearn::TVec< T >::subVec(), targ, weight, and PLearn::VMatrix::weightsize_.
{ source->getExample(i, input, targ, weight); Vec v2; evaluate_functions(functions, input, v2); int l0= 0, l1= v2.length(); v.subVec(l0, l1) << v2; l0+= l1; if(put_raw_input) { l1= input.length(); v.subVec(l0, l1) << input; l0+= l1; } if(put_non_input) { l1= targ.length(); v.subVec(l0, l1) << targ; if(0 < weightsize_) v[l0+l1]= weight; } }
OptionList & PLearn::RealFunctionsProcessedVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
OptionMap & PLearn::RealFunctionsProcessedVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
RemoteMethodMap & PLearn::RealFunctionsProcessedVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::SourceVMatrix.
Definition at line 62 of file RealFunctionsProcessedVMatrix.cc.
void PLearn::RealFunctionsProcessedVMatrix::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::SourceVMatrix.
Definition at line 123 of file RealFunctionsProcessedVMatrix.cc.
References PLearn::deepCopyField(), functions, input, PLearn::SourceVMatrix::makeDeepCopyFromShallowCopy(), and targ.
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(input, copies); deepCopyField(targ, copies); deepCopyField(functions, copies); }
Reimplemented from PLearn::SourceVMatrix.
Definition at line 109 of file RealFunctionsProcessedVMatrix.h.
Definition at line 69 of file RealFunctionsProcessedVMatrix.h.
Referenced by build_(), declareOptions(), getNewRow(), and makeDeepCopyFromShallowCopy().
Vec PLearn::RealFunctionsProcessedVMatrix::input [mutable, protected] |
Definition at line 60 of file RealFunctionsProcessedVMatrix.h.
Referenced by getNewRow(), and makeDeepCopyFromShallowCopy().
Definition at line 72 of file RealFunctionsProcessedVMatrix.h.
Referenced by build_(), declareOptions(), and getNewRow().
Definition at line 71 of file RealFunctionsProcessedVMatrix.h.
Referenced by build_(), declareOptions(), and getNewRow().
Vec PLearn::RealFunctionsProcessedVMatrix::targ [mutable, protected] |
Definition at line 61 of file RealFunctionsProcessedVMatrix.h.
Referenced by getNewRow(), and makeDeepCopyFromShallowCopy().
real PLearn::RealFunctionsProcessedVMatrix::weight [mutable, protected] |
Definition at line 62 of file RealFunctionsProcessedVMatrix.h.
Referenced by getNewRow().