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

PLearn::ConcatOfVariable Class Reference

#include <ConcatOfVariable.h>

Inheritance diagram for PLearn::ConcatOfVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ConcatOfVariable ()
 Default constructor for persistence.

 ConcatOfVariable (VMat the_distr, Func the_f)
 PLEARN_DECLARE_OBJECT (ConcatOfVariable)
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 Attributes

VMat distr
Func f
Vec input_value
 Vec to hold one input sample.

Vec input_gradient
 //!< Vec to hold the gradient for one input sample


Private Types

typedef NaryVariable inherited

Private Member Functions

void build_ ()

Member Typedef Documentation

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

Reimplemented from PLearn::NaryVariable.

Definition at line 55 of file ConcatOfVariable.h.

Referenced by ConcatOfVariable().


Constructor & Destructor Documentation

PLearn::ConcatOfVariable::ConcatOfVariable  )  [inline]
 

Default constructor for persistence.

Definition at line 66 of file ConcatOfVariable.h.

PLearn::ConcatOfVariable::ConcatOfVariable VMat  the_distr,
Func  the_f
 

Definition at line 55 of file ConcatOfVariable.cc.

References build_(), inherited, and PLearn::nonInputParentsOfPath().


Member Function Documentation

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

Implements PLearn::Variable.

Definition at line 138 of file ConcatOfVariable.cc.

References fbprop().

void PLearn::ConcatOfVariable::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 84 of file ConcatOfVariable.cc.

References build_().

void PLearn::ConcatOfVariable::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 91 of file ConcatOfVariable.cc.

References distr, f, input_gradient, input_value, PLERROR, PLearn::TVec< T >::resize(), and PLearn::VMat::width().

Referenced by build(), and ConcatOfVariable().

void PLearn::ConcatOfVariable::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 76 of file ConcatOfVariable.cc.

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

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

do both fprop and bprop

Reimplemented from PLearn::Variable.

Definition at line 144 of file ConcatOfVariable.cc.

References distr, f, input_gradient, input_value, PLearn::VMat::length(), and PLearn::TVec< T >::subVec().

Referenced by bprop().

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

compute output given input

Implements PLearn::Variable.

Definition at line 124 of file ConcatOfVariable.cc.

References distr, f, input_value, PLearn::VMat::length(), and PLearn::TVec< T >::subVec().

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

Reimplemented from PLearn::NaryVariable.

Definition at line 113 of file ConcatOfVariable.cc.

References PLearn::deepCopyField(), distr, f, input_gradient, and input_value.

PLearn::ConcatOfVariable::PLEARN_DECLARE_OBJECT ConcatOfVariable   ) 
 

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

References distr, f, and PLearn::VMat::length().


Member Data Documentation

VMat PLearn::ConcatOfVariable::distr [protected]
 

Definition at line 58 of file ConcatOfVariable.h.

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

Func PLearn::ConcatOfVariable::f [protected]
 

Definition at line 59 of file ConcatOfVariable.h.

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

Vec PLearn::ConcatOfVariable::input_gradient [protected]
 

//!< Vec to hold the gradient for one input sample

Definition at line 62 of file ConcatOfVariable.h.

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

Vec PLearn::ConcatOfVariable::input_value [protected]
 

Vec to hold one input sample.

Definition at line 61 of file ConcatOfVariable.h.

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


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