PLearn 0.1
|
This allows to apply a costfunction on a single output element (and correponding target element) of a larger output vector, rather than on the whole vector. More...
#include <SelectedOutputCostFunction.h>
Public Member Functions | |
SelectedOutputCostFunction () | |
SelectedOutputCostFunction (Ker the_costfunc, int the_outputindex) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual SelectedOutputCostFunction * | deepCopy (CopiesMap &copies) const |
virtual string | info () const |
Returns a bit more informative string about object (default returns classname()) | |
virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be. | |
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_ |
Static Protected Member Functions | |
static void | declareOptions (OptionList &ol) |
recognized option are "outputindex" and "costfunc" | |
Protected Attributes | |
Ker | costfunc |
int | outputindex |
Private Types | |
typedef Kernel | inherited |
This allows to apply a costfunction on a single output element (and correponding target element) of a larger output vector, rather than on the whole vector.
Definition at line 56 of file SelectedOutputCostFunction.h.
typedef Kernel PLearn::SelectedOutputCostFunction::inherited [private] |
Reimplemented from PLearn::Kernel.
Definition at line 58 of file SelectedOutputCostFunction.h.
PLearn::SelectedOutputCostFunction::SelectedOutputCostFunction | ( | ) | [inline] |
Definition at line 65 of file SelectedOutputCostFunction.h.
: costfunc(), outputindex() {}
PLearn::SelectedOutputCostFunction::SelectedOutputCostFunction | ( | Ker | the_costfunc, |
int | the_outputindex | ||
) | [inline] |
Definition at line 66 of file SelectedOutputCostFunction.h.
: costfunc(the_costfunc), outputindex(the_outputindex) {}
string PLearn::SelectedOutputCostFunction::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 50 of file SelectedOutputCostFunction.cc.
OptionList & PLearn::SelectedOutputCostFunction::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 50 of file SelectedOutputCostFunction.cc.
RemoteMethodMap & PLearn::SelectedOutputCostFunction::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 50 of file SelectedOutputCostFunction.cc.
Reimplemented from PLearn::Kernel.
Definition at line 50 of file SelectedOutputCostFunction.cc.
Object * PLearn::SelectedOutputCostFunction::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 50 of file SelectedOutputCostFunction.cc.
StaticInitializer SelectedOutputCostFunction::_static_initializer_ & PLearn::SelectedOutputCostFunction::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 50 of file SelectedOutputCostFunction.cc.
string PLearn::SelectedOutputCostFunction::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 50 of file SelectedOutputCostFunction.cc.
void PLearn::SelectedOutputCostFunction::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
recognized option are "outputindex" and "costfunc"
Reimplemented from PLearn::Kernel.
Definition at line 61 of file SelectedOutputCostFunction.cc.
References PLearn::OptionBase::buildoption, costfunc, PLearn::declareOption(), and outputindex.
{ declareOption(ol, "outputindex", &SelectedOutputCostFunction::outputindex, OptionBase::buildoption, "TODO: Some comments"); declareOption(ol, "costfunc", &SelectedOutputCostFunction::costfunc, OptionBase::buildoption, ""); inherited::declareOptions(ol); }
static const PPath& PLearn::SelectedOutputCostFunction::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Kernel.
Definition at line 69 of file SelectedOutputCostFunction.h.
{ return "selected_output[" + tostring(outputindex) + "] "+costfunc->info(); }
SelectedOutputCostFunction * PLearn::SelectedOutputCostFunction::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Kernel.
Definition at line 50 of file SelectedOutputCostFunction.cc.
real PLearn::SelectedOutputCostFunction::evaluate | ( | const Vec & | x1, |
const Vec & | x2 | ||
) | const [virtual] |
** Subclasses must override this method **
returns K(x1,x2)
Implements PLearn::Kernel.
Definition at line 58 of file SelectedOutputCostFunction.cc.
References PLearn::TVec< T >::subVec().
{ return costfunc(output.subVec(outputindex,1),target.subVec(outputindex,1)); }
OptionList & PLearn::SelectedOutputCostFunction::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 50 of file SelectedOutputCostFunction.cc.
OptionMap & PLearn::SelectedOutputCostFunction::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 50 of file SelectedOutputCostFunction.cc.
RemoteMethodMap & PLearn::SelectedOutputCostFunction::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 50 of file SelectedOutputCostFunction.cc.
virtual string PLearn::SelectedOutputCostFunction::info | ( | ) | const [inline, virtual] |
Returns a bit more informative string about object (default returns classname())
Reimplemented from PLearn::Object.
Definition at line 71 of file SelectedOutputCostFunction.h.
References PLearn::tostring().
{ return "selected_output[" + tostring(outputindex) + "] "+costfunc->info(); }
void PLearn::SelectedOutputCostFunction::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.
This needs to be overridden by every class that adds "complex" data members to the class, such as Vec
, Mat
, PP<Something>
, etc. Typical implementation:
void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies) { inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(complex_data_member1, copies); deepCopyField(complex_data_member2, copies); ... }
copies | A map used by the deep-copy mechanism to keep track of already-copied objects. |
Reimplemented from PLearn::Kernel.
Definition at line 52 of file SelectedOutputCostFunction.cc.
References PLearn::deepCopyField().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(costfunc, copies); }
Reimplemented from PLearn::Kernel.
Definition at line 69 of file SelectedOutputCostFunction.h.
Ker PLearn::SelectedOutputCostFunction::costfunc [protected] |
Definition at line 61 of file SelectedOutputCostFunction.h.
Referenced by declareOptions().
int PLearn::SelectedOutputCostFunction::outputindex [protected] |
Definition at line 62 of file SelectedOutputCostFunction.h.
Referenced by declareOptions().