PLearn 0.1
|
#include <NaryVariable.h>
Public Member Functions | |
NaryVariable () | |
NaryVariable (const VarArray &the_varray, int thelength, int thewidth=1, bool call_build_=true) | |
virtual NaryVariable * | deepCopy (CopiesMap &copies) const |
virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be. | |
virtual void | build () |
Post-constructor. | |
virtual void | setParents (const VarArray &parents) |
set this Variable's parents. To use with default constructor. | |
virtual bool | markPath () |
Sets the marked flag of all the sVariable that are to be in the fprop path. | |
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 | |
static string | _classname_ () |
NaryVariable. | |
static OptionList & | _getOptionList_ () |
static RemoteMethodMap & | _getRemoteMethodMap_ () |
static bool | _isa_ (const Object *o) |
static void | _static_initialize_ () |
static const PPath & | declaringFile () |
Public Attributes | |
VarArray | varray |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Default constructor for persistence. | |
Private Types | |
typedef Variable | inherited |
Private Member Functions | |
void | build_ () |
Object-specific post-constructor. |
Definition at line 59 of file NaryVariable.h.
typedef Variable PLearn::NaryVariable::inherited [private] |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 61 of file NaryVariable.h.
PLearn::NaryVariable::NaryVariable | ( | ) | [inline] |
Definition at line 71 of file NaryVariable.h.
{}
string PLearn::NaryVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 53 of file NaryVariable.cc.
OptionList & PLearn::NaryVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 53 of file NaryVariable.cc.
RemoteMethodMap & PLearn::NaryVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 53 of file NaryVariable.cc.
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 53 of file NaryVariable.cc.
StaticInitializer NaryVariable::_static_initializer_ & PLearn::NaryVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 53 of file NaryVariable.cc.
VarArray PLearn::NaryVariable::ancestors | ( | ) | [virtual] |
if not marked, find all Variables that influence this Variable.
Implements PLearn::Variable.
Definition at line 165 of file NaryVariable.cc.
References a, i, PLearn::Variable::marked, PLearn::TVec< T >::size(), PLearn::Variable::Var, and varray.
{ VarArray a(0,0); if (marked) return a; marked = true; for(int i=0; i<varray.size(); i++) if (!varray[i].isNull()) a &= varray[i]->ancestors(); a &= Var(this); return a; }
void PLearn::NaryVariable::build | ( | ) | [virtual] |
Post-constructor.
The normal implementation 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.
Reimplemented in PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 81 of file NaryVariable.cc.
References PLearn::Variable::build(), and build_().
Referenced by PLearn::WeightedLogGaussian::build(), PLearn::VarArrayElementVariable::build(), PLearn::UnfoldedSumOfVariable::build(), PLearn::UnfoldedFuncVariable::build(), PLearn::TransposedDoubleProductVariable::build(), PLearn::SumOverBagsVariable::build(), PLearn::SumOfVariable::build(), PLearn::SemiSupervisedProbClassCostVariable::build(), PLearn::ScoreLayerVariable::build(), PLearn::PotentialsVariable::build(), PLearn::PlusManyVariable::build(), PLearn::NllSemisphericalGaussianVariable::build(), PLearn::NllGeneralGaussianVariable::build(), PLearn::NegLogPoissonVariable::build(), PLearn::MatrixSumOfVariable::build(), PLearn::MatrixElementsVariable::build(), PLearn::LocalizedFeaturesLayerVariable::build(), PLearn::LinearCombinationOfScalarVariables::build(), PLearn::IfThenElseVariable::build(), PLearn::HeterogenuousAffineTransformWeightPenalty::build(), PLearn::HeterogenuousAffineTransformVariable::build(), PLearn::GaussianProcessNLLVariable::build(), PLearn::FNetLayerVariable::build(), PLearn::DoubleProductVariable::build(), PLearn::DiagonalizedFactorsProductVariable::build(), PLearn::ConfRatedAdaboostCostVariable::build(), PLearn::ConcatRowsVariable::build(), PLearn::ConcatOfVariable::build(), PLearn::ConcatColumnsVariable::build(), PLearn::CCCostVariable::build(), PLearn::BiasWeightAffineTransformVariable::build(), PLearn::UnfoldedFuncVariable::build_(), PLearn::SumOverBagsVariable::build_(), PLearn::SumOfVariable::build_(), PLearn::ScoreLayerVariable::build_(), and PLearn::NNet::buildOutputFromInput().
{ inherited::build(); build_(); }
void PLearn::NaryVariable::build_ | ( | ) | [private] |
Object-specific post-constructor.
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 its parent's build_()
has already been called.
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 90 of file NaryVariable.cc.
Referenced by build(), and NaryVariable().
{
// Nothing to do here.
}
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 122 of file NaryVariable.cc.
References PLearn::Variable::clearMark(), i, PLearn::Variable::marked, PLearn::TVec< T >::size(), PLearn::Variable::Var, and varray.
{ if(marked) { for(int i=0; i<varray.size(); i++) if (!varray[i].isNull()) varray[i]->buildPath(proppath); proppath &= Var(this); clearMark(); } }
void PLearn::NaryVariable::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Default constructor for persistence.
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::CCCostVariable, PLearn::ConcatOfVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, and PLearn::ScoreLayerVariable.
Definition at line 70 of file NaryVariable.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Variable::declareOptions(), and varray.
Referenced by PLearn::UnfoldedSumOfVariable::declareOptions(), PLearn::UnfoldedFuncVariable::declareOptions(), PLearn::TransposedDoubleProductVariable::declareOptions(), PLearn::SumOverBagsVariable::declareOptions(), PLearn::SumOfVariable::declareOptions(), PLearn::SoftSlopeVariable::declareOptions(), PLearn::SoftSlopeIntegralVariable::declareOptions(), PLearn::SemiSupervisedProbClassCostVariable::declareOptions(), PLearn::ScoreLayerVariable::declareOptions(), PLearn::PotentialsVariable::declareOptions(), PLearn::PlusManyVariable::declareOptions(), PLearn::MatrixSumOfVariable::declareOptions(), PLearn::MatrixElementsVariable::declareOptions(), PLearn::LocalizedFeaturesLayerVariable::declareOptions(), PLearn::LinearCombinationOfScalarVariables::declareOptions(), PLearn::HeterogenuousAffineTransformWeightPenalty::declareOptions(), PLearn::HeterogenuousAffineTransformVariable::declareOptions(), PLearn::GaussianProcessNLLVariable::declareOptions(), PLearn::FNetLayerVariable::declareOptions(), PLearn::DoubleProductVariable::declareOptions(), PLearn::ConcatOfVariable::declareOptions(), and PLearn::CCCostVariable::declareOptions().
{ declareOption(ol, "varray", &NaryVariable::varray, OptionBase::buildoption, "The array of parent variables that this one depends on."); inherited::declareOptions(ol); }
static const PPath& PLearn::NaryVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 75 of file NaryVariable.h.
{
NaryVariable * PLearn::NaryVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 53 of file NaryVariable.cc.
void PLearn::NaryVariable::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.
This needs to be overridden by every class that adds "complex" data members to the class, such as Vec
, Mat
, PP<Something>
, etc. Typical implementation:
void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies) { inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(complex_data_member1, copies); deepCopyField(complex_data_member2, copies); ... }
copies | A map used by the deep-copy mechanism to keep track of already-copied objects. |
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatOfVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NllGeneralGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, and PLearn::ScoreLayerVariable.
Definition at line 98 of file NaryVariable.cc.
References PLearn::deepCopyField(), PLearn::Variable::makeDeepCopyFromShallowCopy(), and varray.
Referenced by PLearn::UnfoldedSumOfVariable::makeDeepCopyFromShallowCopy(), PLearn::UnfoldedFuncVariable::makeDeepCopyFromShallowCopy(), PLearn::TransposedDoubleProductVariable::makeDeepCopyFromShallowCopy(), PLearn::SumOverBagsVariable::makeDeepCopyFromShallowCopy(), PLearn::SumOfVariable::makeDeepCopyFromShallowCopy(), PLearn::ScoreLayerVariable::makeDeepCopyFromShallowCopy(), PLearn::PotentialsVariable::makeDeepCopyFromShallowCopy(), PLearn::PlusManyVariable::makeDeepCopyFromShallowCopy(), PLearn::MatrixSumOfVariable::makeDeepCopyFromShallowCopy(), PLearn::MatrixElementsVariable::makeDeepCopyFromShallowCopy(), PLearn::LocalizedFeaturesLayerVariable::makeDeepCopyFromShallowCopy(), PLearn::LinearCombinationOfScalarVariables::makeDeepCopyFromShallowCopy(), PLearn::HeterogenuousAffineTransformWeightPenalty::makeDeepCopyFromShallowCopy(), PLearn::HeterogenuousAffineTransformVariable::makeDeepCopyFromShallowCopy(), PLearn::GaussianProcessNLLVariable::makeDeepCopyFromShallowCopy(), PLearn::FNetLayerVariable::makeDeepCopyFromShallowCopy(), PLearn::DoubleProductVariable::makeDeepCopyFromShallowCopy(), PLearn::ConcatOfVariable::makeDeepCopyFromShallowCopy(), PLearn::CCCostVariable::makeDeepCopyFromShallowCopy(), PLearn::BiasWeightAffineTransformVariable::makeDeepCopyFromShallowCopy(), and PLearn::ArgminOfVariable::makeDeepCopyFromShallowCopy().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(varray, copies); }
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 110 of file NaryVariable.cc.
References i, PLearn::Variable::marked, PLearn::TVec< T >::size(), and varray.
{ if(!marked) { for(int i=0; i<varray.size(); i++) if (!varray[i].isNull()) marked |= varray[i]->markPath(); } return marked; }
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 191 of file NaryVariable.cc.
References PLearn::TVec< T >::append(), i, PLearn::TVec< T >::size(), and varray.
Referenced by setParents().
{ VarArray unmarked_parents; for(int i=0; i<varray.size(); i++) if (!varray[i].isNull() && !varray[i]->marked) unmarked_parents.append(varray[i]); return unmarked_parents; }
void PLearn::NaryVariable::printInfo | ( | bool | print_gradient | ) | [inline, virtual] |
Implements PLearn::Variable.
Reimplemented in PLearn::CCCostVariable, PLearn::MatrixSumOfVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, and PLearn::UnfoldedSumOfVariable.
Definition at line 91 of file NaryVariable.h.
References PLearn::endl(), i, and PLearn::pout.
{ pout << getName() << "[" << (void*)this << "] " << classname() << "(" << (void*)varray[0]; for (int i=1;i<varray.size();i++) pout << "," << (void*)varray[i]; pout << ") = " << value; if (print_gradient) pout << " gradient=" << gradient; pout << endl; }
VarArray PLearn::NaryVariable::random_sources | ( | ) | [virtual] |
return ancestors which compute a non-deterministic function of their parents
Implements PLearn::Variable.
Definition at line 151 of file NaryVariable.cc.
References a, i, PLearn::Variable::marked, PLearn::TVec< T >::size(), and varray.
{ VarArray a(0,0); if (!marked) { marked = true; for(int i=0; i<varray.size(); i++) if (!varray[i].isNull()) a &= varray[i]->random_sources(); } return a; }
void PLearn::NaryVariable::resizeRValue | ( | ) | [virtual] |
Reimplemented from PLearn::Variable.
Definition at line 201 of file NaryVariable.cc.
References i, PLearn::VarArray::resizeRValue(), PLearn::Variable::resizeRValue(), PLearn::Variable::rvaluedata, PLearn::TVec< T >::size(), and varray.
Referenced by PLearn::SumOfVariable::rfprop(), PLearn::IfThenElseVariable::rfprop(), and PLearn::ConcatRowsVariable::rfprop().
{ inherited::resizeRValue(); for (int i=0; i<varray.size(); i++) if (!varray[i]->rvaluedata) varray[i]->resizeRValue(); }
void PLearn::NaryVariable::setParents | ( | const VarArray & | parents | ) | [virtual] |
set this Variable's parents. To use with default constructor.
Reimplemented from PLearn::Variable.
Definition at line 104 of file NaryVariable.cc.
References parents(), PLearn::Variable::sizeprop(), and varray.
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 135 of file NaryVariable.cc.
References a, i, PLearn::Variable::marked, PLearn::TVec< T >::size(), and varray.
{ VarArray a(0,0); if (!marked) { marked = true; for(int i=0; i<varray.size(); i++) if (!varray[i].isNull()) a &= varray[i]->sources(); //if (a.size()==0) // a &= Var(this); } return a; }
void PLearn::NaryVariable::unmarkAncestors | ( | ) | [virtual] |
undo any marking done by a call to sources() or ancestors()
Implements PLearn::Variable.
Definition at line 179 of file NaryVariable.cc.
References i, PLearn::Variable::marked, PLearn::TVec< T >::size(), and varray.
{ if (marked) { marked = false; for(int i=0; i<varray.size(); i++) if (!varray[i].isNull()) varray[i]->unmarkAncestors(); } }
Reimplemented from PLearn::Variable.
Reimplemented in PLearn::ArgminOfVariable, PLearn::BiasWeightAffineTransformVariable, PLearn::CCCostVariable, PLearn::ConcatColumnsVariable, PLearn::ConcatOfVariable, PLearn::ConcatRowsVariable, PLearn::ConfRatedAdaboostCostVariable, PLearn::DiagonalizedFactorsProductVariable, PLearn::DoubleProductVariable, PLearn::LinearCombinationOfScalarVariables, PLearn::TransposedDoubleProductVariable, PLearn::FNetLayerVariable, PLearn::GaussianProcessNLLVariable, PLearn::HardSlopeVariable, PLearn::HeterogenuousAffineTransformVariable, PLearn::HeterogenuousAffineTransformWeightPenalty, PLearn::IfThenElseVariable, PLearn::LocalizedFeaturesLayerVariable, PLearn::MatrixElementsVariable, PLearn::MatrixSumOfVariable, PLearn::NegLogPoissonVariable, PLearn::NllGeneralGaussianVariable, PLearn::NllSemisphericalGaussianVariable, PLearn::PlusManyVariable, PLearn::PotentialsVariable, PLearn::SemiSupervisedProbClassCostVariable, PLearn::SoftSlopeIntegralVariable, PLearn::SoftSlopeVariable, PLearn::SumOfVariable, PLearn::SumOverBagsVariable, PLearn::UnfoldedFuncVariable, PLearn::UnfoldedSumOfVariable, PLearn::VarArrayElementVariable, PLearn::ScoreLayerVariable, and PLearn::WeightedLogGaussian.
Definition at line 75 of file NaryVariable.h.
Definition at line 66 of file NaryVariable.h.
Referenced by ancestors(), PLearn::VarArrayElementVariable::bprop(), PLearn::SoftSlopeVariable::bprop(), PLearn::SoftSlopeIntegralVariable::bprop(), PLearn::PlusManyVariable::bprop(), PLearn::NllSemisphericalGaussianVariable::bprop(), PLearn::NllGeneralGaussianVariable::bprop(), PLearn::NegLogPoissonVariable::bprop(), PLearn::LocalizedFeaturesLayerVariable::bprop(), PLearn::LinearCombinationOfScalarVariables::bprop(), PLearn::HeterogenuousAffineTransformWeightPenalty::bprop(), PLearn::HeterogenuousAffineTransformVariable::bprop(), PLearn::HardSlopeVariable::bprop(), PLearn::FNetLayerVariable::bprop(), PLearn::DoubleProductVariable::bprop(), PLearn::ConfRatedAdaboostCostVariable::bprop(), PLearn::ConcatRowsVariable::bprop(), PLearn::ConcatColumnsVariable::bprop(), PLearn::VarArrayElementVariable::build_(), PLearn::UnfoldedFuncVariable::build_(), PLearn::SumOverBagsVariable::build_(), PLearn::SumOfVariable::build_(), PLearn::SemiSupervisedProbClassCostVariable::build_(), PLearn::ScoreLayerVariable::build_(), PLearn::PlusManyVariable::build_(), PLearn::NllSemisphericalGaussianVariable::build_(), PLearn::NllGeneralGaussianVariable::build_(), PLearn::NegLogPoissonVariable::build_(), PLearn::LocalizedFeaturesLayerVariable::build_(), PLearn::IfThenElseVariable::build_(), PLearn::HeterogenuousAffineTransformWeightPenalty::build_(), PLearn::HeterogenuousAffineTransformVariable::build_(), PLearn::FNetLayerVariable::build_(), PLearn::DiagonalizedFactorsProductVariable::build_(), PLearn::ConfRatedAdaboostCostVariable::build_(), PLearn::ConcatRowsVariable::build_(), PLearn::ConcatColumnsVariable::build_(), PLearn::BiasWeightAffineTransformVariable::build_(), PLearn::NNet::buildOutputFromInput(), buildPath(), PLearn::LocalizedFeaturesLayerVariable::computeSubsets(), PLearn::UnfoldedFuncVariable::declareOptions(), PLearn::ScoreLayerVariable::declareOptions(), declareOptions(), PLearn::VarArrayElementVariable::fprop(), PLearn::SoftSlopeVariable::fprop(), PLearn::SoftSlopeIntegralVariable::fprop(), PLearn::PlusManyVariable::fprop(), PLearn::NegLogPoissonVariable::fprop(), PLearn::LocalizedFeaturesLayerVariable::fprop(), PLearn::LinearCombinationOfScalarVariables::fprop(), PLearn::HeterogenuousAffineTransformWeightPenalty::fprop(), PLearn::HeterogenuousAffineTransformVariable::fprop(), PLearn::HardSlopeVariable::fprop(), PLearn::FNetLayerVariable::fprop(), PLearn::DoubleProductVariable::fprop(), PLearn::ConfRatedAdaboostCostVariable::fprop(), PLearn::ConcatRowsVariable::fprop(), PLearn::ConcatColumnsVariable::fprop(), makeDeepCopyFromShallowCopy(), markPath(), parents(), random_sources(), PLearn::WeightedLogGaussian::recomputeSize(), PLearn::VarArrayElementVariable::recomputeSize(), PLearn::TransposedDoubleProductVariable::recomputeSize(), PLearn::SoftSlopeVariable::recomputeSize(), PLearn::SoftSlopeIntegralVariable::recomputeSize(), PLearn::PlusManyVariable::recomputeSize(), PLearn::NllSemisphericalGaussianVariable::recomputeSize(), PLearn::NllGeneralGaussianVariable::recomputeSize(), PLearn::LocalizedFeaturesLayerVariable::recomputeSize(), PLearn::LinearCombinationOfScalarVariables::recomputeSize(), PLearn::IfThenElseVariable::recomputeSize(), PLearn::HeterogenuousAffineTransformVariable::recomputeSize(), PLearn::HardSlopeVariable::recomputeSize(), PLearn::FNetLayerVariable::recomputeSize(), PLearn::DoubleProductVariable::recomputeSize(), PLearn::DiagonalizedFactorsProductVariable::recomputeSize(), PLearn::ConfRatedAdaboostCostVariable::recomputeSize(), PLearn::ConcatRowsVariable::recomputeSize(), PLearn::ConcatColumnsVariable::recomputeSize(), resizeRValue(), PLearn::ConcatRowsVariable::rfprop(), setParents(), sources(), PLearn::VarArrayElementVariable::symbolicBprop(), PLearn::ConcatRowsVariable::symbolicBprop(), PLearn::ConcatColumnsVariable::symbolicBprop(), and unmarkAncestors().