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

PLearn::UnfoldedFuncVariable Class Reference

#include <UnfoldedFuncVariable.h>

Inheritance diagram for PLearn::UnfoldedFuncVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UnfoldedFuncVariable ()
 protected default constructor for persistence

 UnfoldedFuncVariable (Var inputmatrix, Func the_f, bool transpose)
 concatenate_{i=0 to n_unfold} f(i-th row of input_matrix)

 PLEARN_DECLARE_OBJECT (UnfoldedFuncVariable)
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
Func f
bool transpose
TVec< VarArrayinputs
TVec< Varoutputs
TVec< VarArrayf_paths

Protected Member Functions

void build_ ()

Private Types

typedef NaryVariable inherited

Member Typedef Documentation

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

Reimplemented from PLearn::NaryVariable.

Definition at line 54 of file UnfoldedFuncVariable.h.

Referenced by UnfoldedFuncVariable().


Constructor & Destructor Documentation

PLearn::UnfoldedFuncVariable::UnfoldedFuncVariable  ) 
 

protected default constructor for persistence

Definition at line 60 of file UnfoldedFuncVariable.cc.

References PLearn::transpose().

PLearn::UnfoldedFuncVariable::UnfoldedFuncVariable Var  inputmatrix,
Func  the_f,
bool  transpose
 

concatenate_{i=0 to n_unfold} f(i-th row of input_matrix)

Definition at line 64 of file UnfoldedFuncVariable.cc.

References build(), inherited, PLearn::nonInputParentsOfPath(), and PLearn::transpose().


Member Function Documentation

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

Implements PLearn::Variable.

Definition at line 165 of file UnfoldedFuncVariable.cc.

References PLearn::TMat< T >::column(), f_paths, input_matrix, PLearn::Var::length(), outputs, transpose, and PLearn::Var::width().

void PLearn::UnfoldedFuncVariable::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 75 of file UnfoldedFuncVariable.cc.

References build_().

Referenced by UnfoldedFuncVariable().

void PLearn::UnfoldedFuncVariable::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 81 of file UnfoldedFuncVariable.cc.

References f, f_paths, input_matrix, inputs, PLearn::Var::length(), outputs, PLERROR, PLearn::propagationPath(), PLearn::TVec< Var >::resize(), PLearn::TVec< VarArray >::resize(), transpose, and PLearn::Var::width().

Referenced by build().

void PLearn::UnfoldedFuncVariable::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 103 of file UnfoldedFuncVariable.cc.

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

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

compute output given input

Implements PLearn::Variable.

Definition at line 145 of file UnfoldedFuncVariable.cc.

References PLearn::TMat< T >::column(), PLearn::Var::column(), f_paths, input_matrix, inputs, PLearn::Var::length(), outputs, transpose, PLearn::Vec, and PLearn::Var::width().

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

Reimplemented from PLearn::NaryVariable.

Definition at line 134 of file UnfoldedFuncVariable.cc.

References PLearn::deepCopyField(), f, f_paths, input_matrix, inputs, and outputs.

PLearn::UnfoldedFuncVariable::PLEARN_DECLARE_OBJECT UnfoldedFuncVariable   ) 
 

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

Reimplemented from PLearn::NaryVariable.

Definition at line 182 of file UnfoldedFuncVariable.cc.

References PLearn::endl(), f_paths, PLearn::Variable::getName(), PLearn::Object::info(), input_matrix, PLearn::Var::length(), outputs, transpose, and PLearn::Var::width().

void PLearn::UnfoldedFuncVariable::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 119 of file UnfoldedFuncVariable.cc.

References f, input_matrix, PLearn::Var::length(), transpose, and PLearn::Var::width().


Member Data Documentation

Func PLearn::UnfoldedFuncVariable::f
 

Definition at line 59 of file UnfoldedFuncVariable.h.

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

TVec<VarArray> PLearn::UnfoldedFuncVariable::f_paths
 

Definition at line 64 of file UnfoldedFuncVariable.h.

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

Var PLearn::UnfoldedFuncVariable::input_matrix
 

Definition at line 58 of file UnfoldedFuncVariable.h.

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

TVec<VarArray> PLearn::UnfoldedFuncVariable::inputs
 

Definition at line 62 of file UnfoldedFuncVariable.h.

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

TVec<Var> PLearn::UnfoldedFuncVariable::outputs
 

Definition at line 63 of file UnfoldedFuncVariable.h.

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

bool PLearn::UnfoldedFuncVariable::transpose
 

Definition at line 60 of file UnfoldedFuncVariable.h.

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


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