PLearn 0.1
|
This is the primitive of a sigmoid: log(1+exp(x)) More...
#include <DilogarithmVariable.h>
Public Member Functions | |
DilogarithmVariable () | |
Default constructor for persistence. | |
DilogarithmVariable (Variable *input) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual DilogarithmVariable * | 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_ () |
DilogarithmVariable. | |
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 |
This is the primitive of a sigmoid: log(1+exp(x))
Definition at line 55 of file DilogarithmVariable.h.
typedef UnaryVariable PLearn::DilogarithmVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 57 of file DilogarithmVariable.h.
PLearn::DilogarithmVariable::DilogarithmVariable | ( | ) | [inline] |
PLearn::DilogarithmVariable::DilogarithmVariable | ( | Variable * | input | ) |
string PLearn::DilogarithmVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
OptionList & PLearn::DilogarithmVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
RemoteMethodMap & PLearn::DilogarithmVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
Object * PLearn::DilogarithmVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
StaticInitializer DilogarithmVariable::_static_initializer_ & PLearn::DilogarithmVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
void PLearn::DilogarithmVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 85 of file DilogarithmVariable.cc.
References PLearn::Variable::gradientdata, i, PLearn::UnaryVariable::input, and PLearn::Variable::nelems().
{ for(int i=0; i<nelems(); i++) { real xi = input->valuedata[i]; if (xi!=0) input->gradientdata[i] -= gradientdata[i] * log1p(-xi)/xi; } }
string PLearn::DilogarithmVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
static const PPath& PLearn::DilogarithmVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 64 of file DilogarithmVariable.h.
{ return new DilogarithmVariable(v); }
DilogarithmVariable * PLearn::DilogarithmVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
void PLearn::DilogarithmVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 72 of file DilogarithmVariable.cc.
References PLearn::dilogarithm(), i, PLearn::UnaryVariable::input, PLearn::is_missing(), PLearn::Variable::nelems(), PLWARNING, and PLearn::Variable::valuedata.
{ for(int i=0; i<nelems(); i++) { valuedata[i] = dilogarithm(input->valuedata[i]); #ifdef BOUNDCHECK if (is_missing(valuedata[i])) PLWARNING("dilogarithm returned NaN"); #endif } }
OptionList & PLearn::DilogarithmVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
OptionMap & PLearn::DilogarithmVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.cc.
RemoteMethodMap & PLearn::DilogarithmVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file DilogarithmVariable.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 DilogarithmVariable.cc.
References PLearn::UnaryVariable::input, PLearn::Var::length(), and PLearn::Var::width().
void PLearn::DilogarithmVariable::symbolicBprop | ( | ) | [virtual] |
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable.
Definition at line 96 of file DilogarithmVariable.cc.
References PLERROR.
{ PLERROR("DilogarithmVariable::symbolicBprop() not implemented"); }
Reimplemented from PLearn::UnaryVariable.
Definition at line 64 of file DilogarithmVariable.h.