PLearn 0.1
|
#include <WeightedSumSquareVariable.h>
Public Member Functions | |
WeightedSumSquareVariable () | |
Default constructor for persistence. | |
WeightedSumSquareVariable (Variable *input, Variable *weights) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual WeightedSumSquareVariable * | deepCopy (CopiesMap &copies) const |
virtual void | build () |
Post-constructor. | |
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 | fprop () |
compute output given input | |
virtual void | bprop () |
virtual void | symbolicBprop () |
compute a piece of new Var graph that represents the symbolic derivative of this Var | |
Static Public Member Functions | |
static string | _classname_ () |
WeightedSumSquareVariable. | |
static OptionList & | _getOptionList_ () |
static RemoteMethodMap & | _getRemoteMethodMap_ () |
static Object * | _new_instance_for_typemap_ () |
static bool | _isa_ (const Object *o) |
static void | _static_initialize_ () |
static const PPath & | declaringFile () |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Protected Member Functions | |
void | build_ () |
This does the actual building. | |
Private Types | |
typedef BinaryVariable | inherited |
Definition at line 56 of file WeightedSumSquareVariable.h.
typedef BinaryVariable PLearn::WeightedSumSquareVariable::inherited [private] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 58 of file WeightedSumSquareVariable.h.
PLearn::WeightedSumSquareVariable::WeightedSumSquareVariable | ( | ) | [inline] |
PLearn::WeightedSumSquareVariable::WeightedSumSquareVariable | ( | Variable * | input, |
Variable * | weights | ||
) |
Definition at line 55 of file WeightedSumSquareVariable.cc.
References build_().
string PLearn::WeightedSumSquareVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 53 of file WeightedSumSquareVariable.cc.
OptionList & PLearn::WeightedSumSquareVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 53 of file WeightedSumSquareVariable.cc.
RemoteMethodMap & PLearn::WeightedSumSquareVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 53 of file WeightedSumSquareVariable.cc.
Reimplemented from PLearn::BinaryVariable.
Definition at line 53 of file WeightedSumSquareVariable.cc.
Object * PLearn::WeightedSumSquareVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 53 of file WeightedSumSquareVariable.cc.
StaticInitializer WeightedSumSquareVariable::_static_initializer_ & PLearn::WeightedSumSquareVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 53 of file WeightedSumSquareVariable.cc.
void PLearn::WeightedSumSquareVariable::bprop | ( | ) | [virtual] |
Implements PLearn::Variable.
Definition at line 94 of file WeightedSumSquareVariable.cc.
References PLearn::Variable::gradientdata, i, PLearn::BinaryVariable::input1, PLearn::BinaryVariable::input2, and n.
void PLearn::WeightedSumSquareVariable::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::BinaryVariable.
Definition at line 62 of file WeightedSumSquareVariable.cc.
References PLearn::BinaryVariable::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::WeightedSumSquareVariable::build_ | ( | ) | [protected] |
This does the actual building.
Reimplemented from PLearn::BinaryVariable.
Definition at line 69 of file WeightedSumSquareVariable.cc.
References PLearn::BinaryVariable::input1, PLearn::BinaryVariable::input2, and PLERROR.
Referenced by build(), and WeightedSumSquareVariable().
{ if (input1 && input2) { // input1 and input2 are (respectively) input and weights from constructor if (input1->nelems() != input2->nelems()) PLERROR("In WeightedSumSquareVariable: input and weights must be the same size;" " input->nelems()=%d weights->nelems()=&d.", input1->nelems(), input2->nelems()); } }
string PLearn::WeightedSumSquareVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 53 of file WeightedSumSquareVariable.cc.
static const PPath& PLearn::WeightedSumSquareVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 65 of file WeightedSumSquareVariable.h.
: void build_();
WeightedSumSquareVariable * PLearn::WeightedSumSquareVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 53 of file WeightedSumSquareVariable.cc.
void PLearn::WeightedSumSquareVariable::fprop | ( | ) | [virtual] |
compute output given input
Implements PLearn::Variable.
Definition at line 85 of file WeightedSumSquareVariable.cc.
References i, PLearn::BinaryVariable::input1, PLearn::BinaryVariable::input2, n, and PLearn::Variable::valuedata.
OptionList & PLearn::WeightedSumSquareVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 53 of file WeightedSumSquareVariable.cc.
OptionMap & PLearn::WeightedSumSquareVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 53 of file WeightedSumSquareVariable.cc.
RemoteMethodMap & PLearn::WeightedSumSquareVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 53 of file WeightedSumSquareVariable.cc.
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 81 of file WeightedSumSquareVariable.cc.
{ l=1; w=1; }
void PLearn::WeightedSumSquareVariable::symbolicBprop | ( | ) | [virtual] |
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable.
Definition at line 105 of file WeightedSumSquareVariable.cc.
References PLearn::Variable::g, PLearn::BinaryVariable::input1, and PLearn::BinaryVariable::input2.
Reimplemented from PLearn::BinaryVariable.
Definition at line 65 of file WeightedSumSquareVariable.h.