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