PLearn 0.1
|
#include <SquareRootVariable.h>
Public Member Functions | |
SquareRootVariable () | |
Default constructor for persistence. | |
SquareRootVariable (Variable *input) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual SquareRootVariable * | 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. | |
Static Public Member Functions | |
static string | _classname_ () |
SquareRootVariable. | |
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 53 of file SquareRootVariable.h.
typedef UnaryVariable PLearn::SquareRootVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 55 of file SquareRootVariable.h.
PLearn::SquareRootVariable::SquareRootVariable | ( | ) | [inline] |
PLearn::SquareRootVariable::SquareRootVariable | ( | Variable * | input | ) |
string PLearn::SquareRootVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
OptionList & PLearn::SquareRootVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
RemoteMethodMap & PLearn::SquareRootVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
Object * PLearn::SquareRootVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
StaticInitializer SquareRootVariable::_static_initializer_ & PLearn::SquareRootVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
void PLearn::SquareRootVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 78 of file SquareRootVariable.cc.
References PLearn::Variable::gradientdata, i, PLearn::UnaryVariable::input, PLearn::TVec< T >::length(), n, PLearn::Variable::nelems(), PLearn::UnaryVariable::resizeRValue(), PLearn::Variable::rValue, PLearn::Variable::rvaluedata, and PLearn::sqrt().
{ if (rValue.length()==0) resizeRValue(); int n=nelems(); for(int i=0; i<n; i++) { input->gradientdata[i] += 0.5/sqrt(input->valuedata[i]) * gradientdata[i]; rvaluedata[i] = 2*input->valuedata[i]*input->rvaluedata[i]; } }
string PLearn::SquareRootVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
static const PPath& PLearn::SquareRootVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 62 of file SquareRootVariable.h.
{ return new SquareRootVariable(v);}
SquareRootVariable * PLearn::SquareRootVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
void PLearn::SquareRootVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 69 of file SquareRootVariable.cc.
References i, PLearn::UnaryVariable::input, n, PLearn::Variable::nelems(), PLearn::sqrt(), and PLearn::Variable::valuedata.
OptionList & PLearn::SquareRootVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
OptionMap & PLearn::SquareRootVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.cc.
RemoteMethodMap & PLearn::SquareRootVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file SquareRootVariable.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 60 of file SquareRootVariable.cc.
References PLearn::UnaryVariable::input, PLearn::Var::length(), and PLearn::Var::width().
Reimplemented from PLearn::UnaryVariable.
Definition at line 62 of file SquareRootVariable.h.