PLearn 0.1
|
A scalar var; equal 1 if input1==input2, 0 otherwise. More...
#include <EqualConstantVariable.h>
Public Member Functions | |
EqualConstantVariable () | |
Default constructor for persistence. | |
EqualConstantVariable (Variable *input1, real input2) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual EqualConstantVariable * | deepCopy (CopiesMap &copies) const |
virtual string | info () const |
Returns a bit more informative string about object (default returns classname()) | |
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_ () |
EqualConstantVariable. | |
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 void | declareOptions (OptionList &ol) |
Declare options (data fields) for the class. | |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Protected Attributes | |
real | eqv |
Private Types | |
typedef UnaryVariable | inherited |
A scalar var; equal 1 if input1==input2, 0 otherwise.
Definition at line 54 of file EqualConstantVariable.h.
typedef UnaryVariable PLearn::EqualConstantVariable::inherited [private] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 56 of file EqualConstantVariable.h.
PLearn::EqualConstantVariable::EqualConstantVariable | ( | ) | [inline] |
Default constructor for persistence.
Definition at line 63 of file EqualConstantVariable.h.
: eqv() {}
Definition at line 55 of file EqualConstantVariable.cc.
string PLearn::EqualConstantVariable::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
OptionList & PLearn::EqualConstantVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
RemoteMethodMap & PLearn::EqualConstantVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
Object * PLearn::EqualConstantVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
StaticInitializer EqualConstantVariable::_static_initializer_ & PLearn::EqualConstantVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
void PLearn::EqualConstantVariable::bprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 83 of file EqualConstantVariable.cc.
{}
string PLearn::EqualConstantVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
void PLearn::EqualConstantVariable::declareOptions | ( | OptionList & | ol | ) | [static] |
Declare options (data fields) for the class.
Redefine this in subclasses: call declareOption
(...) for each option, and then call inherited::declareOptions(options)
. Please call the inherited
method AT THE END to get the options listed in a consistent order (from most recently defined to least recently defined).
static void MyDerivedClass::declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "The size of the input; it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "The learned model weights"); inherited::declareOptions(ol); }
ol | List of options that is progressively being constructed for the current class. |
Reimplemented from PLearn::UnaryVariable.
Definition at line 60 of file EqualConstantVariable.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::UnaryVariable::declareOptions(), and eqv.
{ declareOption(ol, "eqv", &EqualConstantVariable::eqv, OptionBase::buildoption, ""); inherited::declareOptions(ol); }
static const PPath& PLearn::EqualConstantVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 66 of file EqualConstantVariable.h.
EqualConstantVariable * PLearn::EqualConstantVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
void PLearn::EqualConstantVariable::fprop | ( | ) | [virtual] |
Nothing to do by default.
Reimplemented from PLearn::UnaryVariable.
Definition at line 75 of file EqualConstantVariable.cc.
References eqv, i, PLearn::UnaryVariable::input, PLearn::Variable::nelems(), and PLearn::Variable::valuedata.
OptionList & PLearn::EqualConstantVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
OptionMap & PLearn::EqualConstantVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
RemoteMethodMap & PLearn::EqualConstantVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::UnaryVariable.
Definition at line 53 of file EqualConstantVariable.cc.
virtual string PLearn::EqualConstantVariable::info | ( | ) | const [inline, virtual] |
Returns a bit more informative string about object (default returns classname())
Reimplemented from PLearn::Object.
Definition at line 69 of file EqualConstantVariable.h.
References PLearn::tostring().
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 66 of file EqualConstantVariable.cc.
References PLearn::UnaryVariable::input, PLearn::Var::length(), and PLearn::Var::width().
void PLearn::EqualConstantVariable::symbolicBprop | ( | ) | [virtual] |
compute a piece of new Var graph that represents the symbolic derivative of this Var
Reimplemented from PLearn::Variable.
Definition at line 85 of file EqualConstantVariable.cc.
{}
Reimplemented from PLearn::UnaryVariable.
Definition at line 66 of file EqualConstantVariable.h.
real PLearn::EqualConstantVariable::eqv [protected] |
Definition at line 59 of file EqualConstantVariable.h.
Referenced by declareOptions(), and fprop().