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

PLearn::VarArray Class Reference

#include <VarArray.h>

Inheritance diagram for PLearn::VarArray:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef Variterator

Public Member Functions

 VarArray ()
 VarArray (int n, int n_extra=10)
 VarArray (int n, int initial_length, int n_extra)
 VarArray (int n, int initial_length, int initial_width, int n_extra)
 VarArray (const Array< Var > &va)
 VarArray (Array< Var > &va)
 VarArray (const VarArray &va)
 VarArray (const Var &v)
 VarArray (const Var &v1, const Var &v2)
 VarArray (Variable *v)
 VarArray (Variable *v1, Variable *v2)
void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Deep copy of an array is not the same as for a TVec, because the shallow copy automatically creates a new storage.

 operator Var ()
VarArrayoperator &= (const Var &v)
VarArrayoperator &= (const VarArray &va)
VarArray operator & (const Var &v) const
VarArray operator & (const VarArray &va) const
int nelems () const
int sumOfLengths () const
int sumOfWidths () const
int maxWidth () const
int maxLength () const
VarArray nonNull () const
 returns a VarArray containing all the Var's that are non-null

VarArraysubVarArray (int start, int len) const
void copyFrom (int start, int len, const VarArray &from)
void copyFrom (int start, const VarArray &from)
void copyFrom (const Vec &datavec)
void copyValuesFrom (const VarArray &from)
void copyTo (const Vec &datavec) const
void accumulateTo (const Vec &datavec) const
void copyGradientFrom (const Vec &datavec)
void copyGradientFrom (const Array< Vec > &datavec)
void accumulateGradientFrom (const Vec &datavec)
void copyGradientTo (const Vec &datavec)
void copyGradientTo (const Array< Vec > &datavec)
void accumulateGradientTo (const Vec &datavec)
void copyTo (real *x, int n) const
 UNSAFE: x must point to at least n floats!

void accumulateTo (real *x, int n) const
void copyFrom (const real *x, int n)
void makeSharedValue (real *x, int n)
 like copyTo but also makes value's point to x

void makeSharedGradient (real *x, int n)
 like copyGradientTo but also makes value's point to x

void makeSharedValue (PP< Storage< real > > storage, int offset_=0)
 make value and matValue point into this storage

void makeSharedValue (Vec &v, int offset_=0)
void makeSharedGradient (Vec &v, int offset_=0)
void makeSharedGradient (PP< Storage< real > > storage, int offset_=0)
void copyGradientTo (real *x, int n)
void copyGradientFrom (const real *x, int n)
void accumulateGradientFrom (const real *x, int n)
void accumulateGradientTo (real *x, int n)
void copyMinValueTo (const Vec &minv)
void copyMaxValueTo (const Vec &maxv)
void copyMinValueTo (real *x, int n)
void copyMaxValueTo (real *x, int n)
void makeSharedRValue (Vec &v, int offset_=0)
void makeSharedRValue (PP< Storage< real > > storage, int offset_=0)
void copyRValueTo (const Vec &datavec)
void copyRValueFrom (const Vec &datavec)
void copyRValueTo (real *x, int n)
void copyRValueFrom (const real *x, int n)
void resizeRValue ()
void setMark () const
void clearMark () const
void markPath () const
void buildPath (VarArray &fpath) const
void setDontBpropHere (bool val)
void fprop ()
void sizeprop ()
void sizefprop ()
void bprop ()
void bbprop ()
void rfprop ()
void fbprop ()
void fbbprop ()
void fillGradient (real value)
void clearGradient ()
void clearDiagHessian ()
VarArray sources () const
VarArray ancestors () const
void unmarkAncestors () const
VarArray parents () const
 returns the set of all the direct parents of the Var in this array (previously marked parents are NOT included)

void symbolicBprop ()
 computes symbolicBprop on a propagation path

VarArray symbolicGradient ()
 returns a VarArray of all the ->g members of the Vars in this array.

void clearSymbolicGradient ()
 clears the symbolic gradient in all vars of this array

bool update (real step_size, Vec direction, real coeff=1.0, real b=0.0)
bool update (Vec step_sizes, Vec direction, real coeff=1.0, real b=0.0)
 Update the variables in the VarArray with different step sizes, and an optional scaling coefficient + constant coefficient step_sizes and direction must have the same length As with the update with a fixed step size, there is a possible scaling down, and the return value indicates contraints have been hit.

bool update (Vec step_sizes, Vec direction, Vec coeff)
 Same as update(Vec step_sizes, Vec direction, real coeff) except there can be 1 different coeff for each variable.

real maxUpdate (Vec direction)
bool update (real step_size)
void updateAndClear ()
 value += step_size*gradient; gradient.clear();

bool update (Vec new_value)
void read (istream &in)
void write (ostream &out) const
void printNames () const
void printInfo (bool print_gradient=false)
Var operator[] (Var index)
Varoperator[] (int i)
const Varoperator[] (int i) const

Member Typedef Documentation

typedef Var* PLearn::VarArray::iterator
 

Reimplemented from PLearn::Array< Var >.

Definition at line 60 of file VarArray.h.

Referenced by VarArray().


Constructor & Destructor Documentation

PLearn::VarArray::VarArray  ) 
 

Definition at line 49 of file VarArray.cc.

Referenced by subVarArray().

PLearn::VarArray::VarArray int  n,
int  n_extra = 10
[explicit]
 

Definition at line 53 of file VarArray.cc.

PLearn::VarArray::VarArray int  n,
int  initial_length,
int  n_extra
 

Definition at line 57 of file VarArray.cc.

References PLearn::TVec< Var >::data(), and iterator.

PLearn::VarArray::VarArray int  n,
int  initial_length,
int  initial_width,
int  n_extra
 

Definition at line 65 of file VarArray.cc.

References PLearn::TVec< Var >::data().

PLearn::VarArray::VarArray const Array< Var > &  va  )  [inline]
 

Definition at line 66 of file VarArray.h.

PLearn::VarArray::VarArray Array< Var > &  va  )  [inline]
 

Definition at line 67 of file VarArray.h.

PLearn::VarArray::VarArray const VarArray va  )  [inline]
 

Definition at line 68 of file VarArray.h.

PLearn::VarArray::VarArray const Var v  ) 
 

Definition at line 73 of file VarArray.cc.

PLearn::VarArray::VarArray const Var v1,
const Var v2
 

Definition at line 77 of file VarArray.cc.

PLearn::VarArray::VarArray Variable v  ) 
 

Definition at line 84 of file VarArray.cc.

PLearn::VarArray::VarArray Variable v1,
Variable v2
 

Definition at line 88 of file VarArray.cc.


Member Function Documentation

void PLearn::VarArray::accumulateGradientFrom const real x,
int  n
 

Definition at line 364 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::accumulateGradientFrom const Vec datavec  ) 
 

Definition at line 337 of file VarArray.cc.

References accumulateGradientFrom(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by accumulateGradientFrom().

void PLearn::VarArray::accumulateGradientTo real x,
int  n
 

Definition at line 418 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::accumulateGradientTo const Vec datavec  ) 
 

Definition at line 413 of file VarArray.cc.

References accumulateGradientTo(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by accumulateGradientTo().

void PLearn::VarArray::accumulateTo real x,
int  n
const
 

Definition at line 268 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::accumulateTo const Vec datavec  )  const
 

Definition at line 241 of file VarArray.cc.

References accumulateTo(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by accumulateTo(), and PLearn::Function::fbbpropAcc().

VarArray PLearn::VarArray::ancestors  )  const
 

Definition at line 971 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::NaryVariable::ancestors(), and PLearn::displayVarGraph().

void PLearn::VarArray::bbprop  ) 
 

Definition at line 737 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::bprop  ) 
 

Definition at line 729 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::MatrixElementsVariable::bprop(), PLearn::ArgminOfVariable::bprop(), and PLearn::MatrixElementsVariable::fbprop().

void PLearn::VarArray::buildPath VarArray fpath  )  const
 

Definition at line 695 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::NaryVariable::buildPath(), and PLearn::propagationPath().

void PLearn::VarArray::clearDiagHessian  ) 
 

Definition at line 843 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::clearGradient  ) 
 

Definition at line 835 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::MatrixElementsVariable::bprop(), PLearn::ArgminOfVariable::bprop(), PLearn::AdaptGradientOptimizer::build_(), PLearn::ConjGradientOptimizer::computeCostAndDerivative(), PLearn::Optimizer::computeGradient(), PLearn::Optimizer::computeOppositeGradient(), PLearn::MatrixElementsVariable::fbprop(), PLearn::Function::fbprop(), PLearn::ScaledGradientOptimizer::optimize(), PLearn::GradientOptimizer::optimize(), PLearn::GradientOptimizer::optimizeN(), and PLearn::AdaptGradientOptimizer::optimizeN().

void PLearn::VarArray::clearMark  )  const
 

Definition at line 677 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::displayVarGraph(), PLearn::nonInputParentsOfPath(), PLearn::OldDisplayVarGraph(), parents(), and PLearn::propagationPath().

void PLearn::VarArray::clearSymbolicGradient  ) 
 

clears the symbolic gradient in all vars of this array

Definition at line 819 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::Function::differentiate().

void PLearn::VarArray::copyFrom const real x,
int  n
 

Definition at line 123 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyFrom const Vec datavec  ) 
 

Definition at line 118 of file VarArray.cc.

References copyFrom(), PLearn::TVec< T >::data(), PLearn::TVec< T >::length(), and PLearn::Vec.

void PLearn::VarArray::copyFrom int  start,
const VarArray from
[inline]
 

Definition at line 98 of file VarArray.h.

References copyFrom().

void PLearn::VarArray::copyFrom int  start,
int  len,
const VarArray from
 

Definition at line 659 of file VarArray.cc.

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

Referenced by PLearn::ConjGradientOptimizer::computeCostAndDerivative(), PLearn::ConjGradientOptimizer::computeCostValue(), PLearn::ConjGradientOptimizer::computeDerivative(), copyFrom(), PLearn::ConjGradientOptimizer::gSearch(), PLearn::Function::operator()(), and PLearn::operator<<().

void PLearn::VarArray::copyGradientFrom const real x,
int  n
 

Definition at line 342 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyGradientFrom const Array< Vec > &  datavec  ) 
 

Definition at line 295 of file VarArray.cc.

References PLearn::TVec< T >::data(), PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, PLearn::TVec< T >::size(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyGradientFrom const Vec datavec  ) 
 

Definition at line 290 of file VarArray.cc.

References copyGradientFrom(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by copyGradientFrom(), PLearn::Function::fbprop(), and PLearn::ScaledGradientOptimizer::optimize().

void PLearn::VarArray::copyGradientTo real x,
int  n
 

Definition at line 391 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyGradientTo const Array< Vec > &  datavec  ) 
 

Definition at line 317 of file VarArray.cc.

References PLearn::TVec< T >::data(), PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyGradientTo const Vec datavec  ) 
 

Definition at line 386 of file VarArray.cc.

References copyGradientTo(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by PLearn::ConjGradientOptimizer::computeCostAndDerivative(), PLearn::Optimizer::computeGradient(), PLearn::Optimizer::computeOppositeGradient(), copyGradientTo(), PLearn::Function::fbprop(), PLearn::ScaledGradientOptimizer::optimize(), and PLearn::AdaptGradientOptimizer::optimizeN().

void PLearn::VarArray::copyMaxValueTo real x,
int  n
 

Definition at line 472 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyMaxValueTo const Vec maxv  ) 
 

Definition at line 467 of file VarArray.cc.

References copyMaxValueTo(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by copyMaxValueTo().

void PLearn::VarArray::copyMinValueTo real x,
int  n
 

Definition at line 445 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyMinValueTo const Vec minv  ) 
 

Definition at line 440 of file VarArray.cc.

References copyMinValueTo(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by copyMinValueTo().

void PLearn::VarArray::copyRValueFrom const real x,
int  n
 

Definition at line 535 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyRValueFrom const Vec datavec  ) 
 

Definition at line 563 of file VarArray.cc.

References copyRValueFrom(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by copyRValueFrom(), and PLearn::Function::rfprop().

void PLearn::VarArray::copyRValueTo real x,
int  n
 

Definition at line 511 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyRValueTo const Vec datavec  ) 
 

Definition at line 558 of file VarArray.cc.

References copyRValueTo(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by copyRValueTo(), and PLearn::Function::rfprop().

void PLearn::VarArray::copyTo real x,
int  n
const
 

UNSAFE: x must point to at least n floats!

Definition at line 246 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

void PLearn::VarArray::copyTo const Vec datavec  )  const
 

Definition at line 236 of file VarArray.cc.

References copyTo(), PLearn::TVec< T >::data(), and PLearn::TVec< T >::length().

Referenced by PLearn::AdaptGradientOptimizer::build_(), PLearn::ConjGradientOptimizer::computeCostAndDerivative(), PLearn::ConjGradientOptimizer::computeCostValue(), PLearn::ConjGradientOptimizer::computeDerivative(), copyTo(), PLearn::ConjGradientOptimizer::gSearch(), PLearn::operator>>(), and PLearn::AdaptGradientOptimizer::optimizeN().

void PLearn::VarArray::copyValuesFrom const VarArray from  ) 
 

Definition at line 107 of file VarArray.cc.

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

void PLearn::VarArray::fbbprop  ) 
 

Definition at line 781 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLearn::TVec< Var >::last(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::fbprop  ) 
 

Definition at line 755 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLearn::TVec< Var >::last(), PLERROR, and PLearn::TVec< Var >::size().

Referenced by PLearn::ConjGradientOptimizer::computeCostAndDerivative(), PLearn::Optimizer::computeGradient(), PLearn::Optimizer::computeOppositeGradient(), PLearn::Function::fbprop(), PLearn::ScaledGradientOptimizer::optimize(), PLearn::GradientOptimizer::optimize(), PLearn::GradientOptimizer::optimizeN(), PLearn::AdaptGradientOptimizer::optimizeN(), and PLearn::printInfo().

void PLearn::VarArray::fillGradient real  value  ) 
 

Definition at line 827 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::fprop  ) 
 

Definition at line 703 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::MatrixElementsVariable::bprop(), PLearn::Optimizer::build_(), PLearn::AddCostToLearner::computeCostsFromOutputs(), PLearn::ConjGradientOptimizer::computeCostValue(), PLearn::RandomVariable::epoch(), PLearn::Function::fbbprop(), PLearn::Function::fbbpropAcc(), PLearn::MatrixElementsVariable::fbprop(), PLearn::MatrixElementsVariable::fprop(), PLearn::Function::fprop(), PLearn::ArgminOfVariable::fprop(), PLearn::Variable::fprop_from_all_sources(), PLearn::Function::operator()(), PLearn::printInfo(), PLearn::Function::recomputeParents(), PLearn::RandomVarVMatrix::sample(), PLearn::sample(), and PLearn::Optimizer::setToOptimize().

void PLearn::VarArray::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  ) 
 

Deep copy of an array is not the same as for a TVec, because the shallow copy automatically creates a new storage.

Reimplemented from PLearn::Array< Var >.

Definition at line 100 of file VarArray.cc.

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

Referenced by PLearn::deepCopyField(), and PLearn::Function::operator()().

void PLearn::VarArray::makeSharedGradient PP< Storage< real > >  storage,
int  offset_ = 0
 

Definition at line 192 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::makeSharedGradient Vec v,
int  offset_ = 0
 

Definition at line 182 of file VarArray.cc.

References makeSharedGradient(), PLearn::TVec< T >::offset_, and PLearn::TVec< T >::storage.

void PLearn::VarArray::makeSharedGradient real x,
int  n
 

like copyGradientTo but also makes value's point to x

Definition at line 216 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

Referenced by makeSharedGradient().

void PLearn::VarArray::makeSharedRValue PP< Storage< real > >  storage,
int  offset_ = 0
 

Definition at line 494 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::makeSharedRValue Vec v,
int  offset_ = 0
 

Definition at line 187 of file VarArray.cc.

References makeSharedRValue(), PLearn::TVec< T >::offset_, and PLearn::TVec< T >::storage.

Referenced by makeSharedRValue().

void PLearn::VarArray::makeSharedValue Vec v,
int  offset_ = 0
 

Definition at line 208 of file VarArray.cc.

References PLearn::TVec< T >::length(), makeSharedValue(), nelems(), PLERROR, and PLearn::TVec< T >::storage.

void PLearn::VarArray::makeSharedValue PP< Storage< real > >  storage,
int  offset_ = 0
 

make value and matValue point into this storage

Definition at line 166 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::makeSharedValue real x,
int  n
 

like copyTo but also makes value's point to x

Definition at line 146 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, and PLearn::TVec< Var >::size().

Referenced by PLearn::NNet::build_(), PLearn::NeuralNet::build_(), PLearn::NeighborhoodSmoothnessNNet::build_(), PLearn::MultiInstanceNNet::build_(), PLearn::ConditionalDensityNet::build_(), and makeSharedValue().

void PLearn::VarArray::markPath  )  const
 

Definition at line 685 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::NaryVariable::markPath(), and PLearn::propagationPath().

int PLearn::VarArray::maxLength  )  const
 

Definition at line 620 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLearn::Var::length(), and PLearn::TVec< Var >::size().

Referenced by PLearn::ConcatColumnsVariable::recomputeSize().

real PLearn::VarArray::maxUpdate Vec  direction  ) 
 

Using the box constraints on the values, return the maximum allowable step_size in the given direction i.e., argmax_{step_size} {new = value + step_size * direction, new in box}

Definition at line 906 of file VarArray.cc.

References PLearn::TVec< Var >::data(), maxUpdate(), MIN, PLearn::TVec< Var >::size(), and PLearn::TVec< T >::subVec().

Referenced by maxUpdate().

int PLearn::VarArray::maxWidth  )  const
 

Definition at line 606 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLearn::TVec< Var >::size(), and PLearn::Var::width().

Referenced by PLearn::ConcatRowsVariable::recomputeSize().

int PLearn::VarArray::nelems  )  const
 

Definition at line 568 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::AdaptGradientOptimizer::adaptLearningRateALAP1(), PLearn::AdaptGradientOptimizer::adaptLearningRateVariance(), PLearn::SoftSlopeVariable::bprop(), PLearn::SoftSlopeIntegralVariable::bprop(), PLearn::HardSlopeVariable::bprop(), PLearn::TangentLearner::build_(), PLearn::Optimizer::build_(), PLearn::NNet::build_(), PLearn::NeuralNet::build_(), PLearn::NeighborhoodSmoothnessNNet::build_(), PLearn::MultiInstanceNNet::build_(), PLearn::GaussianContinuum::build_(), PLearn::Function::build_(), PLearn::ConjGradientOptimizer::build_(), PLearn::ConditionalDensityNet::build_(), PLearn::AdaptGradientOptimizer::build_(), PLearn::Function::differentiate(), PLearn::SoftSlopeVariable::fprop(), PLearn::SoftSlopeIntegralVariable::fprop(), PLearn::HardSlopeVariable::fprop(), makeSharedValue(), PLearn::AdaptGradientOptimizer::optimizeN(), update(), PLearn::Variable::verifyGradient(), and PLearn::Optimizer::verifyGradient().

VarArray PLearn::VarArray::nonNull  )  const
 

returns a VarArray containing all the Var's that are non-null

Definition at line 634 of file VarArray.cc.

References PLearn::TVec< Var >::append(), PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

VarArray PLearn::VarArray::operator & const VarArray va  )  const [inline]
 

Definition at line 86 of file VarArray.h.

References PLearn::operator &().

VarArray PLearn::VarArray::operator & const Var v  )  const [inline]
 

Definition at line 85 of file VarArray.h.

References PLearn::operator &().

VarArray& PLearn::VarArray::operator &= const VarArray va  )  [inline]
 

Definition at line 84 of file VarArray.h.

References PLearn::operator &=().

VarArray& PLearn::VarArray::operator &= const Var v  )  [inline]
 

Definition at line 83 of file VarArray.h.

References PLearn::operator &=().

PLearn::VarArray::operator Var  )  [inline]
 

Definition at line 76 of file VarArray.h.

References operator[](), PLERROR, and PLearn::TVec< Var >::size().

const Var& PLearn::VarArray::operator[] int  i  )  const [inline]
 

Reimplemented from PLearn::TVec< Var >.

Definition at line 223 of file VarArray.h.

References operator[]().

Var& PLearn::VarArray::operator[] int  i  )  [inline]
 

Definition at line 222 of file VarArray.h.

References operator[]().

Var PLearn::VarArray::operator[] Var  index  ) 
 

Definition at line 956 of file VarArray.cc.

Referenced by operator Var(), and operator[]().

VarArray PLearn::VarArray::parents  )  const
 

returns the set of all the direct parents of the Var in this array (previously marked parents are NOT included)

Definition at line 989 of file VarArray.cc.

References PLearn::TVec< Var >::append(), clearMark(), PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), setMark(), and PLearn::TVec< Var >::size().

Referenced by PLearn::Function::differentiate(), PLearn::nonInputParentsOfPath(), and PLearn::OldDisplayVarGraph().

void PLearn::VarArray::printInfo bool  print_gradient = false  )  [inline]
 

Definition at line 213 of file VarArray.h.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::RandomVariable::epoch(), PLearn::printInfo(), and PLearn::Variable::printInfos().

void PLearn::VarArray::printNames  )  const
 

Definition at line 1009 of file VarArray.cc.

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

void PLearn::VarArray::read istream &  in  ) 
 

Reimplemented from PLearn::Array< Var >.

Definition at line 940 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::resizeRValue  ) 
 

Definition at line 578 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::NaryVariable::resizeRValue().

void PLearn::VarArray::rfprop  ) 
 

Definition at line 745 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::Function::rfprop().

void PLearn::VarArray::setDontBpropHere bool  val  ) 
 

Definition at line 852 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLearn::TVec< Var >::size(), and val.

void PLearn::VarArray::setMark  )  const
 

Definition at line 669 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::displayVarGraph(), PLearn::nonInputParentsOfPath(), PLearn::nonInputSources(), PLearn::OldDisplayVarGraph(), parents(), PLearn::printInfo(), and PLearn::propagationPath().

void PLearn::VarArray::sizefprop  ) 
 

Definition at line 721 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

void PLearn::VarArray::sizeprop  ) 
 

Definition at line 713 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

VarArray PLearn::VarArray::sources  )  const
 

Definition at line 961 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::allSources(), PLearn::displayVarGraph(), PLearn::nonInputSources(), PLearn::OldDisplayVarGraph(), PLearn::propagationPath(), and PLearn::NaryVariable::sources().

VarArray & PLearn::VarArray::subVarArray int  start,
int  len
const
 

Definition at line 645 of file VarArray.cc.

References PLearn::TVec< Var >::append(), PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLERROR, PLearn::TVec< Var >::size(), and VarArray().

int PLearn::VarArray::sumOfLengths  )  const
 

Definition at line 586 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLearn::Var::length(), and PLearn::TVec< Var >::size().

Referenced by PLearn::ConcatRowsVariable::recomputeSize().

int PLearn::VarArray::sumOfWidths  )  const
 

Definition at line 596 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), PLearn::TVec< Var >::size(), and PLearn::Var::width().

Referenced by PLearn::ConcatColumnsVariable::recomputeSize().

void PLearn::VarArray::symbolicBprop  ) 
 

computes symbolicBprop on a propagation path

Definition at line 801 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::Function::differentiate().

VarArray PLearn::VarArray::symbolicGradient  ) 
 

returns a VarArray of all the ->g members of the Vars in this array.

Definition at line 809 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::Function::differentiate().

void PLearn::VarArray::unmarkAncestors  )  const
 

Definition at line 981 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

Referenced by PLearn::allSources(), PLearn::displayVarGraph(), PLearn::nonInputSources(), PLearn::OldDisplayVarGraph(), PLearn::propagationPath(), and PLearn::NaryVariable::unmarkAncestors().

bool PLearn::VarArray::update Vec  new_value  ) 
 

set value = new_value projected down in each direction independently in the subspace in which the box constraints are satisfied. return true if box constraints have been hit with the update

Definition at line 928 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::TVec< Var >::size(), and PLearn::TVec< T >::subVec().

bool PLearn::VarArray::update real  step_size  ) 
 

set value = value + step_size * gradient with step_size possibly scaled down s.t. box constraints are satisfied return true if box constraints have been hit with the update

Definition at line 918 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().

bool PLearn::VarArray::update Vec  step_sizes,
Vec  direction,
Vec  coeff
 

Same as update(Vec step_sizes, Vec direction, real coeff) except there can be 1 different coeff for each variable.

Definition at line 872 of file VarArray.cc.

References PLearn::TVec< Var >::data(), nelems(), PLearn::TVec< Var >::size(), and PLearn::TVec< T >::subVec().

bool PLearn::VarArray::update Vec  step_sizes,
Vec  direction,
real  coeff = 1.0,
real  b = 0.0
 

Update the variables in the VarArray with different step sizes, and an optional scaling coefficient + constant coefficient step_sizes and direction must have the same length As with the update with a fixed step size, there is a possible scaling down, and the return value indicates contraints have been hit.

Definition at line 889 of file VarArray.cc.

References PLearn::TVec< Var >::data(), nelems(), PLearn::TVec< Var >::size(), and PLearn::TVec< T >::subVec().

bool PLearn::VarArray::update real  step_size,
Vec  direction,
real  coeff = 1.0,
real  b = 0.0
 

set value = value + (step_size * coeff + b) * direction with step_size possibly scaled down s.t. box constraints are satisfied return true if box constraints have been hit with the update

Definition at line 860 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::TVec< Var >::size(), and PLearn::TVec< T >::subVec().

Referenced by PLearn::ConjGradientOptimizer::computeCostAndDerivative(), PLearn::ConjGradientOptimizer::computeCostValue(), PLearn::ConjGradientOptimizer::computeDerivative(), PLearn::ConjGradientOptimizer::gSearch(), PLearn::ConjGradientOptimizer::lineSearch(), PLearn::ScaledGradientOptimizer::optimize(), and PLearn::AdaptGradientOptimizer::optimizeN().

void PLearn::VarArray::updateAndClear  )  [inline]
 

value += step_size*gradient; gradient.clear();

Definition at line 227 of file VarArray.h.

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

Referenced by PLearn::GradientOptimizer::optimize(), PLearn::GradientOptimizer::optimizeN(), and PLearn::AdaptGradientOptimizer::optimizeN().

void PLearn::VarArray::write ostream &  out  )  const
 

Reimplemented from PLearn::Array< Var >.

Definition at line 948 of file VarArray.cc.

References PLearn::TVec< Var >::data(), PLearn::PP< Variable >::isNull(), and PLearn::TVec< Var >::size().


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