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

PLearn::NaryVariable Class Reference

#include <NaryVariable.h>

Inheritance diagram for PLearn::NaryVariable:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef Variable inherited

Public Member Functions

 NaryVariable (const VarArray &the_varray, int thelength, int thewidth=1)
 PLEARN_DECLARE_ABSTRACT_OBJECT (NaryVariable)
virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
virtual bool markPath ()
virtual void buildPath (VarArray &proppath)
 Finally buildPath is to be called from the output Variable of interest (this will build the proppath at the same time as erasing the marks).

virtual VarArray sources ()
 if not marked, find all constant sources that influence this Variable.

virtual VarArray random_sources ()
 return ancestors which compute a non-deterministic function of their parents

virtual VarArray ancestors ()
 if not marked, find all Variables that influence this Variable.

virtual void unmarkAncestors ()
 undo any marking done by a call to sources() or ancestors()

virtual VarArray parents ()
 returns all the direct parents of this Var that are not marked (the call doesn't change any mark)

void printInfo (bool print_gradient)
virtual void resizeRValue ()

Public Attributes

VarArray varray

Protected Member Functions

 NaryVariable ()
 Default constructor for persistence.


Static Protected 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)


Member Typedef Documentation

typedef Variable PLearn::NaryVariable::inherited
 

Reimplemented from PLearn::Variable.

Reimplemented in PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::HardSlopeVariable, PLearn::IfThenElseVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, and PLearn::VarArrayElementVariable.

Definition at line 72 of file NaryVariable.h.


Constructor & Destructor Documentation

PLearn::NaryVariable::NaryVariable  )  [inline, protected]
 

Default constructor for persistence.

Definition at line 65 of file NaryVariable.h.

PLearn::NaryVariable::NaryVariable const VarArray the_varray,
int  thelength,
int  thewidth = 1
 

Definition at line 52 of file NaryVariable.cc.


Member Function Documentation

VarArray PLearn::NaryVariable::ancestors  )  [virtual]
 

if not marked, find all Variables that influence this Variable.

Implements PLearn::Variable.

Definition at line 136 of file NaryVariable.cc.

References PLearn::VarArray::ancestors(), PLearn::TVec< Var >::isNull(), PLearn::TVec< Var >::size(), and varray.

void PLearn::NaryVariable::buildPath VarArray proppath  )  [virtual]
 

Finally buildPath is to be called from the output Variable of interest (this will build the proppath at the same time as erasing the marks).

Implements PLearn::Variable.

Definition at line 93 of file NaryVariable.cc.

References PLearn::VarArray::buildPath(), PLearn::Variable::clearMark(), PLearn::TVec< Var >::isNull(), PLearn::TVec< Var >::size(), and varray.

void PLearn::NaryVariable::declareOptions OptionList ol  )  [static, protected]
 

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::Variable.

Reimplemented in PLearn::ConcatOfVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, and PLearn::UnfoldedSumOfVariable.

Definition at line 57 of file NaryVariable.cc.

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

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

Reimplemented from PLearn::Variable.

Reimplemented in PLearn::ArgminOfVariable, PLearn::ConcatOfVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, and PLearn::UnfoldedSumOfVariable.

Definition at line 66 of file NaryVariable.cc.

References PLearn::deepCopyField(), and varray.

bool PLearn::NaryVariable::markPath  )  [virtual]
 

sets the marked flag of all the sVariable that are to be in the fprop path. The input sVariable that are of interest are to be marked first. Then markPath is to be called from the output Variable of interest

Implements PLearn::Variable.

Definition at line 81 of file NaryVariable.cc.

References PLearn::TVec< Var >::isNull(), PLearn::VarArray::markPath(), PLearn::TVec< Var >::size(), and varray.

VarArray PLearn::NaryVariable::parents  )  [virtual]
 

returns all the direct parents of this Var that are not marked (the call doesn't change any mark)

Implements PLearn::Variable.

Definition at line 162 of file NaryVariable.cc.

References PLearn::TVec< Var >::append(), PLearn::TVec< Var >::isNull(), PLearn::TVec< Var >::size(), and varray.

PLearn::NaryVariable::PLEARN_DECLARE_ABSTRACT_OBJECT NaryVariable   ) 
 

void PLearn::NaryVariable::printInfo bool  print_gradient  )  [inline, virtual]
 

Implements PLearn::Variable.

Reimplemented in PLearn::MatrixSumOfVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, and PLearn::UnfoldedSumOfVariable.

Definition at line 89 of file NaryVariable.h.

References PLearn::Object::classname(), PLearn::endl(), PLearn::Variable::getName(), PLearn::TVec< Var >::size(), and varray.

VarArray PLearn::NaryVariable::random_sources  )  [virtual]
 

return ancestors which compute a non-deterministic function of their parents

Implements PLearn::Variable.

Definition at line 122 of file NaryVariable.cc.

References PLearn::TVec< Var >::isNull(), PLearn::TVec< Var >::size(), and varray.

void PLearn::NaryVariable::resizeRValue  )  [virtual]
 

Reimplemented from PLearn::Variable.

Definition at line 172 of file NaryVariable.cc.

References PLearn::VarArray::resizeRValue(), PLearn::TVec< Var >::size(), and varray.

Referenced by PLearn::SumOfVariable::rfprop(), PLearn::IfThenElseVariable::rfprop(), and PLearn::ConcatRowsVariable::rfprop().

VarArray PLearn::NaryVariable::sources  )  [virtual]
 

if not marked, find all constant sources that influence this Variable.

A constant source is normally a SourceVariable.

Implements PLearn::Variable.

Definition at line 106 of file NaryVariable.cc.

References PLearn::TVec< Var >::isNull(), PLearn::TVec< Var >::size(), PLearn::VarArray::sources(), and varray.

void PLearn::NaryVariable::unmarkAncestors  )  [virtual]
 

undo any marking done by a call to sources() or ancestors()

Implements PLearn::Variable.

Definition at line 150 of file NaryVariable.cc.

References PLearn::TVec< Var >::isNull(), PLearn::TVec< Var >::size(), PLearn::VarArray::unmarkAncestors(), and varray.


Member Data Documentation

VarArray PLearn::NaryVariable::varray
 

Definition at line 69 of file NaryVariable.h.

Referenced by ancestors(), buildPath(), makeDeepCopyFromShallowCopy(), markPath(), parents(), printInfo(), random_sources(), resizeRValue(), sources(), and unmarkAncestors().


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