PLearn 0.1
|
#include <NegKernel.h>
Public Member Functions | |
NegKernel () | |
NegKernel (const Ker &the_ker) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual NegKernel * | deepCopy (CopiesMap &copies) const |
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 &x1, const Vec &x2) 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) |
Declare options (data fields) for the class. | |
Protected Attributes | |
Ker | ker |
Private Types | |
typedef Kernel | inherited |
Definition at line 53 of file NegKernel.h.
typedef Kernel PLearn::NegKernel::inherited [private] |
Reimplemented from PLearn::Kernel.
Definition at line 55 of file NegKernel.h.
PLearn::NegKernel::NegKernel | ( | ) | [inline] |
Definition at line 60 of file NegKernel.h.
: ker() {}
PLearn::NegKernel::NegKernel | ( | const Ker & | the_ker | ) | [inline] |
Definition at line 62 of file NegKernel.h.
: ker(the_ker) {}
string PLearn::NegKernel::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file NegKernel.cc.
OptionList & PLearn::NegKernel::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file NegKernel.cc.
RemoteMethodMap & PLearn::NegKernel::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file NegKernel.cc.
Reimplemented from PLearn::Kernel.
Definition at line 49 of file NegKernel.cc.
Object * PLearn::NegKernel::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file NegKernel.cc.
StaticInitializer NegKernel::_static_initializer_ & PLearn::NegKernel::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file NegKernel.cc.
string PLearn::NegKernel::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file NegKernel.cc.
void PLearn::NegKernel::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
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::Kernel.
Definition at line 52 of file NegKernel.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), and ker.
{ declareOption(ol, "ker", &NegKernel::ker, OptionBase::buildoption, ""); inherited::declareOptions(ol); }
static const PPath& PLearn::NegKernel::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Kernel.
Definition at line 65 of file NegKernel.h.
: static void declareOptions(OptionList &ol);
Reimplemented from PLearn::Kernel.
Definition at line 49 of file NegKernel.cc.
** Subclasses must override this method **
returns K(x1,x2)
Implements PLearn::Kernel.
Definition at line 64 of file NegKernel.cc.
{ return -ker->evaluate(x1, x2); }
OptionList & PLearn::NegKernel::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file NegKernel.cc.
OptionMap & PLearn::NegKernel::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file NegKernel.cc.
RemoteMethodMap & PLearn::NegKernel::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file NegKernel.cc.
void PLearn::NegKernel::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 58 of file NegKernel.cc.
References PLearn::deepCopyField().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(ker, copies); }
Reimplemented from PLearn::Kernel.
Definition at line 65 of file NegKernel.h.
Ker PLearn::NegKernel::ker [protected] |
Definition at line 58 of file NegKernel.h.
Referenced by declareOptions().