#include <SumOfVariable.h>
Inheritance diagram for PLearn::SumOfVariable:
Public Member Functions | |
SumOfVariable () | |
protected default constructor for persistence | |
SumOfVariable (VMat the_distr, Func the_f, int the_nsamples=-1) | |
Sum_{inputs distr} f(inputs). | |
PLEARN_DECLARE_OBJECT (SumOfVariable) | |
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 | |
virtual void | symbolicBprop () |
compute a piece of new Var graph that represents the symbolic derivative of this Var | |
virtual void | rfprop () |
void | printInfo (bool print_gradient) |
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) | |
Public Attributes | |
VMat | distr |
Func | f |
int | nsamples |
int | curpos |
current pos in VMat | |
Vec | input_value |
Vec | input_gradient |
Vec | output_value |
Protected Member Functions | |
void | build_ () |
Private Types | |
typedef NaryVariable | inherited |
|
Reimplemented from PLearn::NaryVariable. Definition at line 54 of file SumOfVariable.h. Referenced by SumOfVariable(). |
|
protected default constructor for persistence
Definition at line 69 of file SumOfVariable.h. |
|
Sum_{inputs distr} f(inputs).
Definition at line 58 of file SumOfVariable.cc. References build_(), inherited, and PLearn::nonInputParentsOfPath(). |
|
Implements PLearn::Variable. Definition at line 171 of file SumOfVariable.cc. References fbprop(). |
|
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 73 of file SumOfVariable.cc. References build_(). |
|
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 80 of file SumOfVariable.cc. References distr, f, input_gradient, input_value, PLearn::VMat::length(), nsamples, PLERROR, and PLearn::TVec< T >::resize(). Referenced by build(), and SumOfVariable(). |
|
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 95 of file SumOfVariable.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
do both fprop and bprop
Reimplemented from PLearn::Variable. Definition at line 175 of file SumOfVariable.cc. References PLearn::TVec< T >::clear(), curpos, PLearn::TVec< T >::data(), PLearn::displayFunction(), distr, f, input_gradient, input_value, PLearn::TVec< Var >::length(), PLearn::TVec< T >::length(), PLearn::VMat::length(), nsamples, output_value, PLERROR, PLearn::TVec< T >::resize(), PLearn::Variable::size(), and PLearn::VMat::width(). Referenced by bprop(). |
|
compute output given input
Implements PLearn::Variable. Definition at line 123 of file SumOfVariable.cc. References PLearn::TVec< T >::clear(), curpos, PLearn::TVec< T >::data(), distr, f, input_value, PLearn::TVec< T >::length(), PLearn::VMat::length(), nsamples, output_value, PLERROR, PLearn::TVec< T >::resize(), and PLearn::VMat::width(). |
|
Reimplemented from PLearn::NaryVariable. Definition at line 115 of file SumOfVariable.cc. References PLearn::deepCopyField(), distr, and f. |
|
|
|
Reimplemented from PLearn::NaryVariable. Definition at line 302 of file SumOfVariable.cc. References PLearn::TVec< T >::clear(), curpos, distr, PLearn::endl(), f, PLearn::Variable::getName(), PLearn::Object::info(), input_gradient, input_value, PLearn::VMat::length(), PLearn::Variable::nelems(), nsamples, output_value, PLearn::TVec< T >::resize(), and PLearn::VMat::width(). |
|
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 105 of file SumOfVariable.cc. References f. |
|
Reimplemented from PLearn::Variable. Definition at line 257 of file SumOfVariable.cc. References PLearn::TVec< T >::length(), and PLearn::NaryVariable::resizeRValue(). |
|
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable. Definition at line 236 of file SumOfVariable.cc. |
|
current pos in VMat
Definition at line 61 of file SumOfVariable.h. Referenced by fbprop(), fprop(), printInfo(), and SumOfVariable(). |
|
Definition at line 58 of file SumOfVariable.h. Referenced by build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), printInfo(), and SumOfVariable(). |
|
Definition at line 59 of file SumOfVariable.h. Referenced by build_(), fbprop(), fprop(), makeDeepCopyFromShallowCopy(), printInfo(), recomputeSize(), and SumOfVariable(). |
|
Definition at line 64 of file SumOfVariable.h. Referenced by build_(), fbprop(), and printInfo(). |
|
Definition at line 63 of file SumOfVariable.h. Referenced by build_(), fbprop(), fprop(), and printInfo(). |
|
Definition at line 60 of file SumOfVariable.h. Referenced by build_(), PLearn::AdaptGradientOptimizer::build_(), fbprop(), fprop(), PLearn::GradientOptimizer::optimize(), PLearn::GradientOptimizer::optimizeN(), printInfo(), and SumOfVariable(). |
|
Definition at line 65 of file SumOfVariable.h. Referenced by fbprop(), fprop(), and printInfo(). |