#include <UnfoldedSumOfVariable.h>
Inheritance diagram for PLearn::UnfoldedSumOfVariable:
Public Member Functions | |
UnfoldedSumOfVariable () | |
protected default constructor for persistence | |
UnfoldedSumOfVariable (Var inputmatrix, Var bagsize, Func the_f, int maxbagsize) | |
Sum_{i=0 to bag_size} f(i-th row of input_matrix). | |
PLEARN_DECLARE_OBJECT (UnfoldedSumOfVariable) | |
virtual void | build () |
Should call simply inherited::build(), then this class's build_(). | |
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 (map< const void *, void * > &copies) |
virtual void | fprop () |
compute output given input | |
virtual void | bprop () |
void | printInfo (bool print_gradient) |
Static Public Member Functions | |
void | declareOptions (OptionList &ol) |
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) | |
Public Attributes | |
Var | input_matrix |
Var | bag_size |
Func | f |
int | max_bag_size |
TVec< VarArray > | inputs |
VarArray | outputs |
TVec< VarArray > | f_paths |
Private Types | |
typedef NaryVariable | inherited |
Private Member Functions | |
void | build_ () |
|
Reimplemented from PLearn::NaryVariable. Definition at line 54 of file UnfoldedSumOfVariable.h. Referenced by UnfoldedSumOfVariable(). |
|
protected default constructor for persistence
Definition at line 69 of file UnfoldedSumOfVariable.h. References max_bag_size. |
|
Sum_{i=0 to bag_size} f(i-th row of input_matrix).
Definition at line 58 of file UnfoldedSumOfVariable.cc. References build(), inherited, and PLearn::nonInputParentsOfPath(). |
|
Implements PLearn::Variable. Definition at line 153 of file UnfoldedSumOfVariable.cc. |
|
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::Variable. Definition at line 68 of file UnfoldedSumOfVariable.cc. References build_(). Referenced by UnfoldedSumOfVariable(). |
|
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 it's parent's build_ has already been called. Reimplemented from PLearn::Variable. Definition at line 74 of file UnfoldedSumOfVariable.cc. References f, f_paths, inputs, max_bag_size, outputs, PLERROR, PLearn::propagationPath(), PLearn::TVec< Var >::resize(), and PLearn::TVec< VarArray >::resize(). Referenced by build(). |
|
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); } Reimplemented from PLearn::NaryVariable. Definition at line 95 of file UnfoldedSumOfVariable.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
compute output given input
Implements PLearn::Variable. Definition at line 137 of file UnfoldedSumOfVariable.cc. References bag_size, PLearn::TVec< T >::clear(), f_paths, input_matrix, inputs, max_bag_size, outputs, and PLERROR. |
|
Reimplemented from PLearn::NaryVariable. Definition at line 125 of file UnfoldedSumOfVariable.cc. References bag_size, PLearn::deepCopyField(), f, f_paths, input_matrix, inputs, outputs, and PLearn::varDeepCopyField(). |
|
|
|
Reimplemented from PLearn::NaryVariable. Definition at line 165 of file UnfoldedSumOfVariable.cc. References bag_size, PLearn::endl(), f_paths, PLearn::Variable::getName(), PLearn::Object::info(), input_matrix, max_bag_size, and outputs. |
|
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 113 of file UnfoldedSumOfVariable.cc. References f. |
|
Definition at line 59 of file UnfoldedSumOfVariable.h. Referenced by bprop(), fprop(), makeDeepCopyFromShallowCopy(), and printInfo(). |
|
Definition at line 60 of file UnfoldedSumOfVariable.h. Referenced by build_(), makeDeepCopyFromShallowCopy(), and recomputeSize(). |
|
Definition at line 65 of file UnfoldedSumOfVariable.h. Referenced by bprop(), build_(), fprop(), makeDeepCopyFromShallowCopy(), and printInfo(). |
|
Definition at line 58 of file UnfoldedSumOfVariable.h. Referenced by fprop(), makeDeepCopyFromShallowCopy(), and printInfo(). |
|
Definition at line 63 of file UnfoldedSumOfVariable.h. Referenced by build_(), fprop(), and makeDeepCopyFromShallowCopy(). |
|
Definition at line 61 of file UnfoldedSumOfVariable.h. Referenced by build_(), fprop(), printInfo(), and UnfoldedSumOfVariable(). |
|
Definition at line 64 of file UnfoldedSumOfVariable.h. Referenced by bprop(), build_(), fprop(), makeDeepCopyFromShallowCopy(), and printInfo(). |