PLearn 0.1
|
#include <IdentityVariable.h>
Public Member Functions | |
IdentityVariable () | |
Default constructor for persistence. | |
IdentityVariable (Variable *input) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual IdentityVariable * | 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 | bbprop () |
compute an approximation to diag(d^2/dinput^2) given diag(d^2/doutput^2), with diag(d^2/dinput^2) ~=~ (doutput/dinput)' diag(d^2/doutput^2) (doutput/dinput) In particular: if 'C' depends on 'y' and 'y' depends on x ... | |
virtual void | symbolicBprop () |
compute a piece of new Var graph that represents the symbolic derivative of this Var | |
virtual void | rfprop () |
void | setInput (Var the_input) |
Set this Variable's input (simply call build after setting the new input). | |
Static Public Member Functions | |
static string | _classname_ () |
IdentityVariable. | |
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 |
Definition at line 42 of file IdentityVariable.h.
typedef UnaryVariable PLearn::IdentityVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 43 of file IdentityVariable.h.
PLearn::IdentityVariable::IdentityVariable | ( | ) | [inline] |
PLearn::IdentityVariable::IdentityVariable | ( | Variable * | input | ) |
string PLearn::IdentityVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
OptionList & PLearn::IdentityVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
RemoteMethodMap & PLearn::IdentityVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
Object * PLearn::IdentityVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
StaticInitializer IdentityVariable::_static_initializer_ & PLearn::IdentityVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
void PLearn::IdentityVariable::bbprop | ( | ) | [virtual] |
compute an approximation to diag(d^2/dinput^2) given diag(d^2/doutput^2), with diag(d^2/dinput^2) ~=~ (doutput/dinput)' diag(d^2/doutput^2) (doutput/dinput) In particular: if 'C' depends on 'y' and 'y' depends on x ...
d^2C/dx^2 = d^2C/dy^2 * (dy/dx)^2 + dC/dy * d^2y/dx^2 (diaghessian) (gradient)
Reimplemented from PLearn::Variable.
Definition at line 77 of file IdentityVariable.cc.
References PLERROR.
{ PLERROR("bbprop is not implemented for IdentityVariable"); }
void PLearn::IdentityVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 68 of file IdentityVariable.cc.
References PLearn::Variable::gradientdata, i, PLearn::UnaryVariable::input, and PLearn::Variable::nelems().
{ int l = nelems(); real* inputgradientptr = input->gradientdata; real* gradientptr = gradientdata; for(int i=0; i<l; i++) *inputgradientptr++ += *gradientptr++ * 1.0; }
string PLearn::IdentityVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
static const PPath& PLearn::IdentityVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 50 of file IdentityVariable.h.
{ input = the_input;}
IdentityVariable * PLearn::IdentityVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
void PLearn::IdentityVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 59 of file IdentityVariable.cc.
References i, PLearn::UnaryVariable::input, PLearn::Variable::nelems(), and PLearn::Variable::valuedata.
{ int l = nelems(); real* inputptr = input->valuedata; real* ptr = valuedata; for(int i=0; i<l; i++) *ptr++ = *inputptr++; }
OptionList & PLearn::IdentityVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
OptionMap & PLearn::IdentityVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.cc.
RemoteMethodMap & PLearn::IdentityVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 45 of file IdentityVariable.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 51 of file IdentityVariable.cc.
References PLearn::UnaryVariable::input, PLearn::Var::length(), and PLearn::Var::width().
void PLearn::IdentityVariable::rfprop | ( | ) | [virtual] |
Reimplemented from PLearn::Variable.
Definition at line 86 of file IdentityVariable.cc.
References PLERROR.
{ PLERROR("rfprop is not implemented for IdentityVariable"); }
void PLearn::IdentityVariable::setInput | ( | Var | the_input | ) | [inline] |
Set this Variable's input (simply call build after setting the new input).
Reimplemented from PLearn::UnaryVariable.
Definition at line 58 of file IdentityVariable.h.
{ input = the_input;}
void PLearn::IdentityVariable::symbolicBprop | ( | ) | [virtual] |
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable.
Definition at line 82 of file IdentityVariable.cc.
References PLERROR.
{ PLERROR("symbolicBprop is not implemented for IdentityVariable"); }
Reimplemented from PLearn::UnaryVariable.
Definition at line 50 of file IdentityVariable.h.