PLearn 0.1
|
#include <MulticlassErrorCostFunction.h>
Public Member Functions | |
MulticlassErrorCostFunction () | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual MulticlassErrorCostFunction * | deepCopy (CopiesMap &copies) const |
virtual string | info () const |
Returns a bit more informative string about object (default returns classname()) | |
virtual real | evaluate (const Vec &output, const Vec &target) const |
** Subclasses must override this method ** | |
Static Public Member Functions | |
static string | _classname_ () |
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 Kernel | inherited |
cost = sum_i class_error_i
Definition at line 57 of file MulticlassErrorCostFunction.h.
typedef Kernel PLearn::MulticlassErrorCostFunction::inherited [private] |
Reimplemented from PLearn::Kernel.
Definition at line 59 of file MulticlassErrorCostFunction.h.
PLearn::MulticlassErrorCostFunction::MulticlassErrorCostFunction | ( | ) | [inline] |
Definition at line 62 of file MulticlassErrorCostFunction.h.
{}
string PLearn::MulticlassErrorCostFunction::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
OptionList & PLearn::MulticlassErrorCostFunction::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
RemoteMethodMap & PLearn::MulticlassErrorCostFunction::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
Reimplemented from PLearn::Kernel.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
Object * PLearn::MulticlassErrorCostFunction::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
StaticInitializer MulticlassErrorCostFunction::_static_initializer_ & PLearn::MulticlassErrorCostFunction::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
string PLearn::MulticlassErrorCostFunction::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
static const PPath& PLearn::MulticlassErrorCostFunction::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Kernel.
Definition at line 64 of file MulticlassErrorCostFunction.h.
{ return "multiclass_error"; }
MulticlassErrorCostFunction * PLearn::MulticlassErrorCostFunction::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Kernel.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
real PLearn::MulticlassErrorCostFunction::evaluate | ( | const Vec & | x1, |
const Vec & | x2 | ||
) | const [virtual] |
** Subclasses must override this method **
returns K(x1,x2)
Implements PLearn::Kernel.
Definition at line 53 of file MulticlassErrorCostFunction.cc.
References i, PLearn::TVec< T >::length(), and PLERROR.
{ if (output.length() != target.length()) PLERROR("In MulticlassErrorCostFunction::evaluate: Output vec and target vec must have the same length (%d!=%d", output.length(),target.length()); real cost = 0.0; for (int i=0; i<output.length(); i++) { real output_i = output[i]; int target_i = (int)target[i]; cost += (target_i==1) ? output_i<0.5 : output_i>0.5; } return cost; }
OptionList & PLearn::MulticlassErrorCostFunction::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
OptionMap & PLearn::MulticlassErrorCostFunction::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
RemoteMethodMap & PLearn::MulticlassErrorCostFunction::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 51 of file MulticlassErrorCostFunction.cc.
virtual string PLearn::MulticlassErrorCostFunction::info | ( | ) | const [inline, virtual] |
Returns a bit more informative string about object (default returns classname())
Reimplemented from PLearn::Object.
Definition at line 66 of file MulticlassErrorCostFunction.h.
{ return "multiclass_error"; }
Reimplemented from PLearn::Kernel.
Definition at line 64 of file MulticlassErrorCostFunction.h.