#include <MatrixElementsVariable.h>
Inheritance diagram for PLearn::MatrixElementsVariable:
Public Member Functions | |
MatrixElementsVariable () | |
protected default constructor for persistence | |
MatrixElementsVariable (Variable *the_expression, const Var &i_index, const Var &j_index, int number_of_i_values, int number_of_j_values, const VarArray &the_parameters) | |
PLEARN_DECLARE_OBJECT (MatrixElementsVariable) | |
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 () |
virtual void | fbprop () |
do both fprop and bprop | |
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) | |
Protected Member Functions | |
void | build_ () |
Protected Attributes | |
Var | i |
Var | j |
int | ni |
int | nj |
Var | expression |
VarArray | parameters |
VarArray | full_fproppath |
output(inputs¶meters) | |
VarArray | fproppath |
output(inputs) | |
VarArray | bproppath |
output(parameters) | |
Private Types | |
typedef NaryVariable | inherited |
|
Reimplemented from PLearn::NaryVariable. Definition at line 54 of file MatrixElementsVariable.h. Referenced by MatrixElementsVariable(). |
|
protected default constructor for persistence
Definition at line 70 of file MatrixElementsVariable.h. References bproppath, expression, fproppath, full_fproppath, i, j, ni, nj, and parameters. |
|
Definition at line 62 of file MatrixElementsVariable.cc. |
|
Implements PLearn::Variable. Definition at line 145 of file MatrixElementsVariable.cc. References PLearn::VarArray::bprop(), bproppath, PLearn::VarArray::clearGradient(), expression, PLearn::VarArray::fprop(), fproppath, full_fproppath, i, j, ni, and nj. |
|
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 73 of file MatrixElementsVariable.cc. |
|
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 79 of file MatrixElementsVariable.cc. References bproppath, expression, fproppath, full_fproppath, i, j, parameters, PLERROR, PLearn::propagationPath(), and PLearn::TVec< Var >::size(). Referenced by MatrixElementsVariable(). |
|
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 94 of file MatrixElementsVariable.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
do both fprop and bprop
Reimplemented from PLearn::Variable. Definition at line 173 of file MatrixElementsVariable.cc. References PLearn::VarArray::bprop(), bproppath, PLearn::VarArray::clearGradient(), expression, PLearn::VarArray::fprop(), fproppath, full_fproppath, i, j, ni, and nj. |
|
compute output given input
Implements PLearn::Variable. Definition at line 124 of file MatrixElementsVariable.cc. References expression, PLearn::VarArray::fprop(), fproppath, full_fproppath, i, j, ni, and nj. |
|
Reimplemented from PLearn::NaryVariable. Definition at line 111 of file MatrixElementsVariable.cc. References bproppath, PLearn::deepCopyField(), expression, fproppath, full_fproppath, i, j, parameters, and PLearn::varDeepCopyField(). |
|
|
|
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 105 of file MatrixElementsVariable.cc. |
|
output(parameters)
Definition at line 66 of file MatrixElementsVariable.h. Referenced by bprop(), build_(), fbprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable(). |
|
Definition at line 61 of file MatrixElementsVariable.h. Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable(). |
|
output(inputs)
Definition at line 65 of file MatrixElementsVariable.h. Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable(). |
|
output(inputs¶meters)
Definition at line 64 of file MatrixElementsVariable.h. Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable(). |
|
Definition at line 57 of file MatrixElementsVariable.h. Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable(). |
|
Definition at line 58 of file MatrixElementsVariable.h. Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable(). |
|
Definition at line 59 of file MatrixElementsVariable.h. Referenced by bprop(), fbprop(), fprop(), MatrixElementsVariable(), and recomputeSize(). |
|
Definition at line 60 of file MatrixElementsVariable.h. Referenced by bprop(), fbprop(), fprop(), MatrixElementsVariable(), and recomputeSize(). |
|
Definition at line 62 of file MatrixElementsVariable.h. Referenced by build_(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable(). |