PLearn 0.1
|
#include <DiagVariable.h>
Public Member Functions | |
DiagVariable () | |
Default constructor. | |
DiagVariable (Variable *input, bool call_build_=true) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual DiagVariable * | 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 () |
Nothing to do by default. | |
virtual void | bprop () |
Nothing to do by default. | |
virtual void | bbprop () |
here don't approximate, do d2C/dx^2 = 4 x^2 d2C/dy^2 + 2 dC/dy | |
virtual void | symbolicBprop () |
compute a piece of new Var graph that represents the symbolic derivative of this Var | |
virtual void | rfprop () |
Static Public Member Functions | |
static string | _classname_ () |
DiagVariable. | |
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 |
Private Member Functions | |
void | build_ () |
Object-specific post-constructor. |
Definition at line 48 of file DiagVariable.h.
typedef UnaryVariable PLearn::DiagVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 50 of file DiagVariable.h.
PLearn::DiagVariable::DiagVariable | ( | ) |
string PLearn::DiagVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
OptionList & PLearn::DiagVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
RemoteMethodMap & PLearn::DiagVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
Object * PLearn::DiagVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
StaticInitializer DiagVariable::_static_initializer_ & PLearn::DiagVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
void PLearn::DiagVariable::bbprop | ( | ) | [virtual] |
here don't approximate, do d2C/dx^2 = 4 x^2 d2C/dy^2 + 2 dC/dy
Reimplemented from PLearn::Variable.
Definition at line 116 of file DiagVariable.cc.
References PLERROR.
{ PLERROR("bbprop not implemented for this variable"); }
void PLearn::DiagVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 107 of file DiagVariable.cc.
References PLearn::Variable::gradient, i, PLearn::UnaryVariable::input, and PLearn::TVec< T >::length().
{ int l = gradient.length(); Mat G = input->matGradient; for(int i=0; i<l; i++) G(i,i) += gradient[i]; }
void PLearn::DiagVariable::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::UnaryVariable.
Definition at line 72 of file DiagVariable.cc.
References PLearn::UnaryVariable::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::DiagVariable::build_ | ( | ) | [private] |
Object-specific post-constructor.
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 its parent's build_()
has already been called.
Reimplemented from PLearn::UnaryVariable.
Definition at line 80 of file DiagVariable.cc.
Referenced by build(), and DiagVariable().
{
// Nothing to do here.
}
string PLearn::DiagVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
static const PPath& PLearn::DiagVariable::declaringFile | ( | ) | [inline, static] |
DiagVariable * PLearn::DiagVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
void PLearn::DiagVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 99 of file DiagVariable.cc.
References i, PLearn::UnaryVariable::input, PLearn::TVec< T >::length(), and PLearn::Variable::value.
OptionList & PLearn::DiagVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
OptionMap & PLearn::DiagVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.cc.
RemoteMethodMap & PLearn::DiagVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file DiagVariable.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 87 of file DiagVariable.cc.
References PLearn::UnaryVariable::input, PLearn::Var::length(), PLearn::min(), and PLearn::Var::width().
void PLearn::DiagVariable::rfprop | ( | ) | [virtual] |
Reimplemented from PLearn::Variable.
Definition at line 128 of file DiagVariable.cc.
References PLERROR.
{ PLERROR("rfprop no yet implemented for this vairable"); }
void PLearn::DiagVariable::symbolicBprop | ( | ) | [virtual] |
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable.
Definition at line 122 of file DiagVariable.cc.
References PLERROR.
{ PLERROR("symbolic bprop not yet implemented for this variable"); }
Reimplemented from PLearn::UnaryVariable.
Definition at line 59 of file DiagVariable.h.