PLearn 0.1
|
result is a single column that contains the sum of each row of the input More...
#include <RowSumVariable.h>
Public Member Functions | |
RowSumVariable () | |
Default constructor for persistence. | |
RowSumVariable (Variable *input) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual RowSumVariable * | deepCopy (CopiesMap &copies) const |
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 () |
Nothing to do by default. | |
virtual void | bprop () |
Nothing to do by default. | |
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_ () |
RowSumVariable. | |
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_ |
Private Types | |
typedef UnaryVariable | inherited |
result is a single column that contains the sum of each row of the input
Definition at line 53 of file RowSumVariable.h.
typedef UnaryVariable PLearn::RowSumVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 55 of file RowSumVariable.h.
PLearn::RowSumVariable::RowSumVariable | ( | ) | [inline] |
PLearn::RowSumVariable::RowSumVariable | ( | Variable * | input | ) |
Definition at line 55 of file RowSumVariable.cc.
string PLearn::RowSumVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
OptionList & PLearn::RowSumVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
RemoteMethodMap & PLearn::RowSumVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
Object * PLearn::RowSumVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
StaticInitializer RowSumVariable::_static_initializer_ & PLearn::RowSumVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
void PLearn::RowSumVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 78 of file RowSumVariable.cc.
References PLearn::Variable::gradientdata, i, PLearn::UnaryVariable::input, j, PLearn::Var::length(), and PLearn::Var::width().
{ int k=0; for(int i=0; i<input->length(); i++) for(int j=0; j<input->width(); j++, k++) input->gradientdata[k] += gradientdata[i]; }
string PLearn::RowSumVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
static const PPath& PLearn::RowSumVariable::declaringFile | ( | ) | [inline, static] |
RowSumVariable * PLearn::RowSumVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
void PLearn::RowSumVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 68 of file RowSumVariable.cc.
References PLearn::TVec< T >::clear(), i, PLearn::UnaryVariable::input, j, PLearn::Var::length(), PLearn::Variable::value, PLearn::Variable::valuedata, and PLearn::Var::width().
{ value.clear(); int k=0; for(int i=0; i<input->length(); i++) for(int j=0; j<input->width(); j++, k++) valuedata[i] += input->valuedata[k]; }
OptionList & PLearn::RowSumVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
OptionMap & PLearn::RowSumVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.cc.
RemoteMethodMap & PLearn::RowSumVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file RowSumVariable.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 59 of file RowSumVariable.cc.
References PLearn::UnaryVariable::input, and PLearn::Var::length().
void PLearn::RowSumVariable::symbolicBprop | ( | ) | [virtual] |
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable.
Definition at line 87 of file RowSumVariable.cc.
References PLearn::Variable::g, and PLearn::UnaryVariable::input.
Reimplemented from PLearn::UnaryVariable.
Definition at line 62 of file RowSumVariable.h.