PLearn 0.1
|
#include <BinaryClassificationLossVariable.h>
Public Member Functions | |
BinaryClassificationLossVariable () | |
Default constructor for persistence. | |
BinaryClassificationLossVariable (Variable *netout, Variable *classnum) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual BinaryClassificationLossVariable * | 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 () |
compute output given input | |
virtual void | bprop () |
can't bprop through a hard classification error... | |
Static Public Member Functions | |
static string | _classname_ () |
BinaryClassificationLossVariable. | |
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 () |
Public Attributes | |
int | class_1 |
int | class_2 |
real | threshold |
Static Public Attributes | |
static StaticInitializer | _static_initializer_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Private Types | |
typedef BinaryVariable | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. |
Definition at line 53 of file BinaryClassificationLossVariable.h.
typedef BinaryVariable PLearn::BinaryClassificationLossVariable::inherited [private] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 55 of file BinaryClassificationLossVariable.h.
PLearn::BinaryClassificationLossVariable::BinaryClassificationLossVariable | ( | ) |
Default constructor for persistence.
Definition at line 58 of file BinaryClassificationLossVariable.cc.
: threshold(0.0) { }
string PLearn::BinaryClassificationLossVariable::_classname_ | ( | ) | [static] |
BinaryClassificationLossVariable.
Reimplemented from PLearn::BinaryVariable.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
OptionList & PLearn::BinaryClassificationLossVariable::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
RemoteMethodMap & PLearn::BinaryClassificationLossVariable::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
Reimplemented from PLearn::BinaryVariable.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
Object * PLearn::BinaryClassificationLossVariable::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
StaticInitializer BinaryClassificationLossVariable::_static_initializer_ & PLearn::BinaryClassificationLossVariable::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
virtual void PLearn::BinaryClassificationLossVariable::bprop | ( | ) | [inline, virtual] |
can't bprop through a hard classification error...
Implements PLearn::Variable.
Definition at line 73 of file BinaryClassificationLossVariable.h.
{}
void PLearn::BinaryClassificationLossVariable::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::BinaryVariable.
Definition at line 81 of file BinaryClassificationLossVariable.cc.
References PLearn::BinaryVariable::build(), and build_().
{ inherited::build(); build_(); }
void PLearn::BinaryClassificationLossVariable::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::BinaryVariable.
Definition at line 88 of file BinaryClassificationLossVariable.cc.
References PLearn::BinaryVariable::input2, and PLERROR.
Referenced by BinaryClassificationLossVariable(), and build().
{ // input2 == classnum from constructor if (input2 && !input2->isScalar()) PLERROR("In BinaryClassificationLossVariable: classnum must be a scalar variable representing an index of netout (typically a class number)"); }
string PLearn::BinaryClassificationLossVariable::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
void PLearn::BinaryClassificationLossVariable::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares this class' options.
Reimplemented from PLearn::BinaryVariable.
Definition at line 65 of file BinaryClassificationLossVariable.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::BinaryVariable::declareOptions(), and threshold.
{ declareOption(ol, "threshold", &BinaryClassificationLossVariable::threshold, OptionBase::buildoption, "The threshold under which the class is 'class_1', and above which the class is 'class_2'."); inherited::declareOptions(ol); }
static const PPath& PLearn::BinaryClassificationLossVariable::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 66 of file BinaryClassificationLossVariable.h.
{}
BinaryClassificationLossVariable * PLearn::BinaryClassificationLossVariable::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::BinaryVariable.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
void PLearn::BinaryClassificationLossVariable::fprop | ( | ) | [virtual] |
compute output given input
Implements PLearn::Variable.
Definition at line 99 of file BinaryClassificationLossVariable.cc.
References class_1, class_2, PLearn::BinaryVariable::input1, PLearn::BinaryVariable::input2, threshold, and PLearn::Variable::valuedata.
OptionList & PLearn::BinaryClassificationLossVariable::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
OptionMap & PLearn::BinaryClassificationLossVariable::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 55 of file BinaryClassificationLossVariable.cc.
RemoteMethodMap & PLearn::BinaryClassificationLossVariable::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 55 of file BinaryClassificationLossVariable.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 95 of file BinaryClassificationLossVariable.cc.
{ l=1, w=1; }
Reimplemented from PLearn::BinaryVariable.
Definition at line 66 of file BinaryClassificationLossVariable.h.
Definition at line 59 of file BinaryClassificationLossVariable.h.
Referenced by fprop().
Definition at line 59 of file BinaryClassificationLossVariable.h.
Referenced by fprop().
Definition at line 60 of file BinaryClassificationLossVariable.h.
Referenced by declareOptions(), and fprop().