PLearn 0.1
|
#include <ErfVariable.h>
Public Member Functions | |
ErfVariable () | |
Default constructor for persistence. | |
ErfVariable (Variable *input) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual ErfVariable * | 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_ () |
ErfVariable. | |
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 52 of file ErfVariable.h.
typedef UnaryVariable PLearn::ErfVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 54 of file ErfVariable.h.
PLearn::ErfVariable::ErfVariable | ( | ) | [inline] |
PLearn::ErfVariable::ErfVariable | ( | Variable * | input | ) |
string PLearn::ErfVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
OptionList & PLearn::ErfVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
RemoteMethodMap & PLearn::ErfVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
Object * PLearn::ErfVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
StaticInitializer ErfVariable::_static_initializer_ & PLearn::ErfVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
void PLearn::ErfVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 79 of file ErfVariable.cc.
References PLearn::exp(), PLearn::Variable::gradientdata, i, PLearn::UnaryVariable::input, PLearn::Variable::nelems(), Pi, and PLearn::sqrt().
{ real cst = 2.0/sqrt(Pi); for(int i=0; i<nelems(); i++) input->gradientdata[i] += gradientdata[i] * cst*exp(input->valuedata[i]*input->valuedata[i]); }
string PLearn::ErfVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
static const PPath& PLearn::ErfVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 61 of file ErfVariable.h.
{ return new ErfVariable(v); }
ErfVariable * PLearn::ErfVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
void PLearn::ErfVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 72 of file ErfVariable.cc.
References i, PLearn::UnaryVariable::input, PLearn::Variable::nelems(), PLearn::pl_erf(), and PLearn::Variable::valuedata.
OptionList & PLearn::ErfVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
OptionMap & PLearn::ErfVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.cc.
RemoteMethodMap & PLearn::ErfVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file ErfVariable.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 63 of file ErfVariable.cc.
References PLearn::UnaryVariable::input, PLearn::Var::length(), and PLearn::Var::width().
void PLearn::ErfVariable::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 ErfVariable.cc.
References PLearn::exp(), PLearn::Variable::g, PLearn::UnaryVariable::input, Pi, PLearn::sqrt(), and PLearn::square().
Reimplemented from PLearn::UnaryVariable.
Definition at line 61 of file ErfVariable.h.