Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::MatrixElementsVariable Class Reference

#include <MatrixElementsVariable.h>

Inheritance diagram for PLearn::MatrixElementsVariable:

Inheritance graph
[legend]
Collaboration diagram for PLearn::MatrixElementsVariable:

Collaboration graph
[legend]
List of all members.

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&parameters)

VarArray fproppath
 output(inputs)

VarArray bproppath
 output(parameters)


Private Types

typedef NaryVariable inherited

Member Typedef Documentation

typedef NaryVariable PLearn::MatrixElementsVariable::inherited [private]
 

Reimplemented from PLearn::NaryVariable.

Definition at line 54 of file MatrixElementsVariable.h.

Referenced by MatrixElementsVariable().


Constructor & Destructor Documentation

PLearn::MatrixElementsVariable::MatrixElementsVariable  )  [inline]
 

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.

PLearn::MatrixElementsVariable::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
 

Definition at line 62 of file MatrixElementsVariable.cc.

References build_(), and inherited.


Member Function Documentation

void PLearn::MatrixElementsVariable::bprop  )  [virtual]
 

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.

void PLearn::MatrixElementsVariable::build  )  [virtual]
 

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.

void PLearn::MatrixElementsVariable::build_  )  [protected]
 

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().

void PLearn::MatrixElementsVariable::declareOptions OptionList ol  )  [static]
 

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.

void PLearn::MatrixElementsVariable::fbprop  )  [virtual]
 

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.

void PLearn::MatrixElementsVariable::fprop  )  [virtual]
 

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.

void PLearn::MatrixElementsVariable::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

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().

PLearn::MatrixElementsVariable::PLEARN_DECLARE_OBJECT MatrixElementsVariable   ) 
 

void PLearn::MatrixElementsVariable::recomputeSize int l,
int w
const [virtual]
 

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.

References ni, and nj.


Member Data Documentation

VarArray PLearn::MatrixElementsVariable::bproppath [protected]
 

output(parameters)

Definition at line 66 of file MatrixElementsVariable.h.

Referenced by bprop(), build_(), fbprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable().

Var PLearn::MatrixElementsVariable::expression [protected]
 

Definition at line 61 of file MatrixElementsVariable.h.

Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable().

VarArray PLearn::MatrixElementsVariable::fproppath [protected]
 

output(inputs)

Definition at line 65 of file MatrixElementsVariable.h.

Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable().

VarArray PLearn::MatrixElementsVariable::full_fproppath [protected]
 

output(inputs&parameters)

Definition at line 64 of file MatrixElementsVariable.h.

Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable().

Var PLearn::MatrixElementsVariable::i [protected]
 

Definition at line 57 of file MatrixElementsVariable.h.

Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable().

Var PLearn::MatrixElementsVariable::j [protected]
 

Definition at line 58 of file MatrixElementsVariable.h.

Referenced by bprop(), build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable().

int PLearn::MatrixElementsVariable::ni [protected]
 

Definition at line 59 of file MatrixElementsVariable.h.

Referenced by bprop(), fbprop(), fprop(), MatrixElementsVariable(), and recomputeSize().

int PLearn::MatrixElementsVariable::nj [protected]
 

Definition at line 60 of file MatrixElementsVariable.h.

Referenced by bprop(), fbprop(), fprop(), MatrixElementsVariable(), and recomputeSize().

VarArray PLearn::MatrixElementsVariable::parameters [protected]
 

Definition at line 62 of file MatrixElementsVariable.h.

Referenced by build_(), makeDeepCopyFromShallowCopy(), and MatrixElementsVariable().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:25:09 2004 for PLearn by doxygen 1.3.7