PLearn 0.1
|
#include <RowOfVariable.h>
Public Member Functions | |
RowOfVariable () | |
protected default constructor for persistence | |
RowOfVariable (VMat the_distr, Var index) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual RowOfVariable * | deepCopy (CopiesMap &copies) const |
virtual void | build () |
Post-constructor. | |
virtual void | recomputeSize (int &l, int &w) const |
Recomputes the length l and width w that this variable should have, according to its parent variables. | |
virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be. | |
virtual void | fprop () |
Nothing to do by default. | |
virtual void | bprop () |
Nothing to do by default. | |
virtual void | fbprop () |
do both fprop and bprop | |
virtual void | symbolicBprop () |
compute a piece of new Var graph that represents the symbolic derivative of this Var | |
virtual void | rfprop () |
Static Public Member Functions | |
static string | _classname_ () |
RowOfVariable. | |
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 void | declareOptions (OptionList &ol) |
Declare options (data fields) for the class. | |
Public Attributes | |
VMat | distr |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Protected Member Functions | |
void | build_ () |
Object-specific post-constructor. | |
Private Types | |
typedef UnaryVariable | inherited |
Definition at line 53 of file RowOfVariable.h.
typedef UnaryVariable PLearn::RowOfVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 55 of file RowOfVariable.h.
PLearn::RowOfVariable::RowOfVariable | ( | ) | [inline] |
protected default constructor for persistence
Definition at line 63 of file RowOfVariable.h.
: distr() {}
string PLearn::RowOfVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
OptionList & PLearn::RowOfVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
RemoteMethodMap & PLearn::RowOfVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
Object * PLearn::RowOfVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
StaticInitializer RowOfVariable::_static_initializer_ & PLearn::RowOfVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
void PLearn::RowOfVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 108 of file RowOfVariable.cc.
{ }
void PLearn::RowOfVariable::build | ( | ) | [virtual] |
Post-constructor.
The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.
Reimplemented from PLearn::UnaryVariable.
Definition at line 65 of file RowOfVariable.cc.
References PLearn::UnaryVariable::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::RowOfVariable::build_ | ( | ) | [protected] |
Object-specific post-constructor.
This method should be redefined in subclasses and do the actual building of the object according to previously set option fields. Constructors can just set option fields, and then call build_. This method is NOT virtual, and will typically be called only from three places: a constructor, the public virtual build()
method, and possibly the public virtual read method (which calls its parent's read). build_()
can assume that its parent's build_()
has already been called.
Reimplemented from PLearn::UnaryVariable.
Definition at line 72 of file RowOfVariable.cc.
Referenced by build(), and RowOfVariable().
{ }
string PLearn::RowOfVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
void PLearn::RowOfVariable::declareOptions | ( | OptionList & | ol | ) | [static] |
Declare options (data fields) for the class.
Redefine this in subclasses: call declareOption
(...) for each option, and then call inherited::declareOptions(options)
. Please call the inherited
method AT THE END to get the options listed in a consistent order (from most recently defined to least recently defined).
static void MyDerivedClass::declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "The size of the input; it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "The learned model weights"); inherited::declareOptions(ol); }
ol | List of options that is progressively being constructed for the current class. |
Reimplemented from PLearn::UnaryVariable.
Definition at line 77 of file RowOfVariable.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::UnaryVariable::declareOptions(), and distr.
{ declareOption(ol, "distr", &RowOfVariable::distr, OptionBase::buildoption, "VMat containing the rows to output"); inherited::declareOptions(ol); }
static const PPath& PLearn::RowOfVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 67 of file RowOfVariable.h.
: void build_();
RowOfVariable * PLearn::RowOfVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
void PLearn::RowOfVariable::fbprop | ( | ) | [virtual] |
do both fprop and bprop
Reimplemented from PLearn::Variable.
Definition at line 112 of file RowOfVariable.cc.
{}
void PLearn::RowOfVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 101 of file RowOfVariable.cc.
References distr, i, PLearn::UnaryVariable::input, and PLearn::Variable::matValue.
OptionList & PLearn::RowOfVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
OptionMap & PLearn::RowOfVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
RemoteMethodMap & PLearn::RowOfVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file RowOfVariable.cc.
void PLearn::RowOfVariable::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.
This needs to be overridden by every class that adds "complex" data members to the class, such as Vec
, Mat
, PP<Something>
, etc. Typical implementation:
void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies) { inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(complex_data_member1, copies); deepCopyField(complex_data_member2, copies); ... }
copies | A map used by the deep-copy mechanism to keep track of already-copied objects. |
Reimplemented from PLearn::UnaryVariable.
Definition at line 94 of file RowOfVariable.cc.
References PLearn::deepCopyField(), distr, and PLearn::UnaryVariable::makeDeepCopyFromShallowCopy().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(distr, copies); }
Recomputes the length l and width w that this variable should have, according to its parent variables.
This is used for ex. by sizeprop() The default version stupidly returns the current dimensions, so make sure to overload it in subclasses if this is not appropriate.
Reimplemented from PLearn::Variable.
Definition at line 84 of file RowOfVariable.cc.
References distr, PLearn::UnaryVariable::input, and PLearn::VMat::width().
void PLearn::RowOfVariable::rfprop | ( | ) | [virtual] |
Reimplemented from PLearn::Variable.
Definition at line 119 of file RowOfVariable.cc.
References PLERROR.
{PLERROR("RowOfVariable::symbolicBprop(): not implemented");}
void PLearn::RowOfVariable::symbolicBprop | ( | ) | [virtual] |
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable.
Definition at line 116 of file RowOfVariable.cc.
References PLERROR.
{PLERROR("RowOfVariable::symbolicBprop(): not implemented");}
Reimplemented from PLearn::UnaryVariable.
Definition at line 67 of file RowOfVariable.h.
Definition at line 59 of file RowOfVariable.h.
Referenced by declareOptions(), fprop(), makeDeepCopyFromShallowCopy(), and recomputeSize().