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

PLearn::BinaryVariable Class Reference

#include <BinaryVariable.h>

Inheritance diagram for PLearn::BinaryVariable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BinaryVariable ()
 BinaryVariable (Variable *v1, Variable *v2, int thelength, int thewidth)
 BinaryVariable *.

 PLEARN_DECLARE_ABSTRACT_OBJECT (BinaryVariable)
virtual void setParents (const VarArray &parents)
 set this Variable's parents. To use with default constructor.

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

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

Var input1
Var input2

Private Types

typedef Variable inherited

Member Typedef Documentation

typedef Variable PLearn::BinaryVariable::inherited [private]
 

Reimplemented from PLearn::Variable.

Reimplemented in PLearn::AffineTransformVariable, PLearn::BinaryClassificationLossVariable, PLearn::ClassificationLossVariable, PLearn::ColumnIndexVariable, PLearn::ConvolveVariable, PLearn::CrossEntropyVariable, PLearn::DivVariable, PLearn::DotProductVariable, PLearn::ElementAtPositionVariable, PLearn::EqualScalarVariable, PLearn::EqualVariable, PLearn::IndexAtPositionVariable, PLearn::IsLargerVariable, PLearn::IsSmallerVariable, PLearn::LiftOutputVariable, PLearn::LogAddVariable, PLearn::MarginPerceptronCostVariable, PLearn::MatrixAffineTransformFeedbackVariable, PLearn::MatrixAffineTransformVariable, PLearn::MatrixOneHotSquaredLoss, PLearn::MatrixSoftmaxLossVariable, PLearn::Max2Variable, PLearn::MiniBatchClassificationLossVariable, PLearn::MinusColumnVariable, PLearn::MinusRowVariable, PLearn::MinusScalarVariable, PLearn::MinusTransposedColumnVariable, PLearn::MinusVariable, PLearn::MulticlassLossVariable, PLearn::NegCrossEntropySigmoidVariable, PLearn::OneHotSquaredLoss, PLearn::PlusColumnVariable, PLearn::PlusRowVariable, PLearn::PlusScalarVariable, PLearn::PlusVariable, PLearn::PowVariableVariable, PLearn::ProductTransposeVariable, PLearn::ProductVariable, PLearn::ProjectionErrorVariable, PLearn::RowAtPositionVariable, PLearn::SoftmaxLossVariable, PLearn::TimesColumnVariable, PLearn::TimesRowVariable, PLearn::TimesScalarVariable, PLearn::TimesVariable, PLearn::TransposeProductVariable, PLearn::VarColumnsVariable, PLearn::VarElementVariable, PLearn::VarRowsVariable, PLearn::VarRowVariable, and PLearn::WeightedSumSquareVariable.

Definition at line 55 of file BinaryVariable.h.


Constructor & Destructor Documentation

PLearn::BinaryVariable::BinaryVariable  )  [inline]
 

Definition at line 62 of file BinaryVariable.h.

PLearn::BinaryVariable::BinaryVariable Variable v1,
Variable v2,
int  thelength,
int  thewidth
 

BinaryVariable *.

Definition at line 51 of file BinaryVariable.cc.

References input1, and input2.


Member Function Documentation

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

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

Implements PLearn::Variable.

Definition at line 143 of file BinaryVariable.cc.

References input1, and input2.

void PLearn::BinaryVariable::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 112 of file BinaryVariable.cc.

References PLearn::Variable::clearMark(), input1, and input2.

void PLearn::BinaryVariable::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::Variable.

Reimplemented in PLearn::ElementAtPositionVariable, PLearn::IndexAtPositionVariable, PLearn::MarginPerceptronCostVariable, PLearn::MatrixOneHotSquaredLoss, PLearn::OneHotSquaredLoss, and PLearn::RowAtPositionVariable.

Definition at line 61 of file BinaryVariable.cc.

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

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

Reimplemented from PLearn::Variable.

Definition at line 94 of file BinaryVariable.cc.

References input1, input2, and PLearn::varDeepCopyField().

Referenced by PLearn::DiagonalNormalSampleVariable::deepCopy().

bool PLearn::BinaryVariable::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 104 of file BinaryVariable.cc.

References input1, and input2.

VarArray PLearn::BinaryVariable::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 163 of file BinaryVariable.cc.

References PLearn::TVec< Var >::append(), input1, and input2.

PLearn::BinaryVariable::PLEARN_DECLARE_ABSTRACT_OBJECT BinaryVariable   ) 
 

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

Implements PLearn::Variable.

Definition at line 77 of file BinaryVariable.h.

References PLearn::endl(), PLearn::Variable::getName(), input1, and input2.

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

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

Implements PLearn::Variable.

Reimplemented in PLearn::BinarySampleVariable.

Definition at line 134 of file BinaryVariable.cc.

References input1, and input2.

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

Reimplemented from PLearn::Variable.

Definition at line 174 of file BinaryVariable.cc.

References input1, and input2.

Referenced by PLearn::VarRowVariable::rfprop(), PLearn::VarElementVariable::rfprop(), PLearn::TransposeProductVariable::rfprop(), PLearn::TimesScalarVariable::rfprop(), PLearn::TimesRowVariable::rfprop(), PLearn::TimesColumnVariable::rfprop(), PLearn::SoftmaxLossVariable::rfprop(), PLearn::RowAtPositionVariable::rfprop(), PLearn::ProductVariable::rfprop(), PLearn::ProductTransposeVariable::rfprop(), PLearn::PlusScalarVariable::rfprop(), PLearn::PlusRowVariable::rfprop(), PLearn::PlusColumnVariable::rfprop(), PLearn::MinusScalarVariable::rfprop(), PLearn::ElementAtPositionVariable::rfprop(), PLearn::DotProductVariable::rfprop(), and PLearn::DivVariable::rfprop().

void PLearn::BinaryVariable::setParents const VarArray parents  )  [virtual]
 

set this Variable's parents. To use with default constructor.

Reimplemented from PLearn::Variable.

Definition at line 72 of file BinaryVariable.cc.

References input1, input2, PLearn::TVec< Var >::length(), and PLERROR.

VarArray PLearn::BinaryVariable::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 125 of file BinaryVariable.cc.

References input1, and input2.

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

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

Implements PLearn::Variable.

Definition at line 152 of file BinaryVariable.cc.

References input1, and input2.


Member Data Documentation

Var PLearn::BinaryVariable::input1 [protected]
 

Definition at line 58 of file BinaryVariable.h.

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

Var PLearn::BinaryVariable::input2 [protected]
 

Definition at line 59 of file BinaryVariable.h.

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


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