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

PLearn::UnfoldedSumOfVariable Class Reference

#include <UnfoldedSumOfVariable.h>

Inheritance diagram for PLearn::UnfoldedSumOfVariable:

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

Collaboration graph
[legend]
List of all members.

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< VarArrayinputs
VarArray outputs
TVec< VarArrayf_paths

Private Types

typedef NaryVariable inherited

Private Member Functions

void build_ ()

Member Typedef Documentation

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

Reimplemented from PLearn::NaryVariable.

Definition at line 54 of file UnfoldedSumOfVariable.h.

Referenced by UnfoldedSumOfVariable().


Constructor & Destructor Documentation

PLearn::UnfoldedSumOfVariable::UnfoldedSumOfVariable  )  [inline]
 

protected default constructor for persistence

Definition at line 69 of file UnfoldedSumOfVariable.h.

References max_bag_size.

PLearn::UnfoldedSumOfVariable::UnfoldedSumOfVariable Var  inputmatrix,
Var  bagsize,
Func  the_f,
int  maxbagsize
 

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


Member Function Documentation

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

Implements PLearn::Variable.

Definition at line 153 of file UnfoldedSumOfVariable.cc.

References bag_size, f_paths, and outputs.

void PLearn::UnfoldedSumOfVariable::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 68 of file UnfoldedSumOfVariable.cc.

References build_().

Referenced by UnfoldedSumOfVariable().

void PLearn::UnfoldedSumOfVariable::build_  )  [private]
 

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

void PLearn::UnfoldedSumOfVariable::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 95 of file UnfoldedSumOfVariable.cc.

References PLearn::declareOption(), and PLearn::OptionList.

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

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.

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

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

PLearn::UnfoldedSumOfVariable::PLEARN_DECLARE_OBJECT UnfoldedSumOfVariable   ) 
 

void PLearn::UnfoldedSumOfVariable::printInfo bool  print_gradient  )  [virtual]
 

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.

void PLearn::UnfoldedSumOfVariable::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 113 of file UnfoldedSumOfVariable.cc.

References f.


Member Data Documentation

Var PLearn::UnfoldedSumOfVariable::bag_size
 

Definition at line 59 of file UnfoldedSumOfVariable.h.

Referenced by bprop(), fprop(), makeDeepCopyFromShallowCopy(), and printInfo().

Func PLearn::UnfoldedSumOfVariable::f
 

Definition at line 60 of file UnfoldedSumOfVariable.h.

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

TVec<VarArray> PLearn::UnfoldedSumOfVariable::f_paths
 

Definition at line 65 of file UnfoldedSumOfVariable.h.

Referenced by bprop(), build_(), fprop(), makeDeepCopyFromShallowCopy(), and printInfo().

Var PLearn::UnfoldedSumOfVariable::input_matrix
 

Definition at line 58 of file UnfoldedSumOfVariable.h.

Referenced by fprop(), makeDeepCopyFromShallowCopy(), and printInfo().

TVec<VarArray> PLearn::UnfoldedSumOfVariable::inputs
 

Definition at line 63 of file UnfoldedSumOfVariable.h.

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

int PLearn::UnfoldedSumOfVariable::max_bag_size
 

Definition at line 61 of file UnfoldedSumOfVariable.h.

Referenced by build_(), fprop(), printInfo(), and UnfoldedSumOfVariable().

VarArray PLearn::UnfoldedSumOfVariable::outputs
 

Definition at line 64 of file UnfoldedSumOfVariable.h.

Referenced by bprop(), build_(), fprop(), makeDeepCopyFromShallowCopy(), and printInfo().


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