PLearn 0.1
|
returns exp(-(sum_i phi_i*[abs(x1_i^a - x2_i^a)^b])^c) More...
#include <ScaledGeneralizedDistanceRBFKernel.h>
Public Member Functions | |
ScaledGeneralizedDistanceRBFKernel () | |
ScaledGeneralizedDistanceRBFKernel (Vec the_phi, Vec the_a, real the_b, real the_c) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual ScaledGeneralizedDistanceRBFKernel * | 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) |
recognized options are "b" and "c" | |
Protected Attributes | |
real | b |
real | c |
Vec | phi |
Vec | a |
Private Types | |
typedef Kernel | inherited |
returns exp(-(sum_i phi_i*[abs(x1_i^a - x2_i^a)^b])^c)
Definition at line 54 of file ScaledGeneralizedDistanceRBFKernel.h.
typedef Kernel PLearn::ScaledGeneralizedDistanceRBFKernel::inherited [private] |
Reimplemented from PLearn::Kernel.
Definition at line 56 of file ScaledGeneralizedDistanceRBFKernel.h.
PLearn::ScaledGeneralizedDistanceRBFKernel::ScaledGeneralizedDistanceRBFKernel | ( | ) | [inline] |
string PLearn::ScaledGeneralizedDistanceRBFKernel::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
OptionList & PLearn::ScaledGeneralizedDistanceRBFKernel::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
RemoteMethodMap & PLearn::ScaledGeneralizedDistanceRBFKernel::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
Object * PLearn::ScaledGeneralizedDistanceRBFKernel::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
StaticInitializer ScaledGeneralizedDistanceRBFKernel::_static_initializer_ & PLearn::ScaledGeneralizedDistanceRBFKernel::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
string PLearn::ScaledGeneralizedDistanceRBFKernel::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
void PLearn::ScaledGeneralizedDistanceRBFKernel::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
recognized options are "b" and "c"
Reimplemented from PLearn::Kernel.
Definition at line 73 of file ScaledGeneralizedDistanceRBFKernel.cc.
References PLearn::OptionBase::buildoption, PLearn::declareOption(), and phi.
{ declareOption(ol, "phi", &ScaledGeneralizedDistanceRBFKernel::phi, OptionBase::buildoption, "TODO: Some comments"); declareOption(ol, "a", &ScaledGeneralizedDistanceRBFKernel::phi, OptionBase::buildoption, "TODO: Some comments"); declareOption(ol, "b", &ScaledGeneralizedDistanceRBFKernel::phi, OptionBase::buildoption, "TODO: Some comments"); declareOption(ol, "c", &ScaledGeneralizedDistanceRBFKernel::phi, OptionBase::buildoption, "TODO: Some comments"); inherited::declareOptions(ol); }
static const PPath& PLearn::ScaledGeneralizedDistanceRBFKernel::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Kernel.
Definition at line 69 of file ScaledGeneralizedDistanceRBFKernel.h.
:
ScaledGeneralizedDistanceRBFKernel * PLearn::ScaledGeneralizedDistanceRBFKernel::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
real PLearn::ScaledGeneralizedDistanceRBFKernel::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 ScaledGeneralizedDistanceRBFKernel.cc.
References a, b, c, PLearn::exp(), i, PLearn::TVec< T >::length(), PLERROR, and PLearn::pow().
{ #ifdef BOUNDCHECK if(x1.length()!=x2.length()) PLERROR("IN ScaledGeneralizedDistanceRBFKernel::evaluate x1 and x2 must have the same length"); #endif real summ = 0.0; real* ph=phi.data(); real* aa=a.data(); for(int i=0; i<x1.length(); i++) summ += ph[i]*pow(fabs(pow(x1[i],aa[i])-pow(x2[i],aa[i])), (real)b); return exp(-pow(summ,c)); }
OptionList & PLearn::ScaledGeneralizedDistanceRBFKernel::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
OptionMap & PLearn::ScaledGeneralizedDistanceRBFKernel::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
RemoteMethodMap & PLearn::ScaledGeneralizedDistanceRBFKernel::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledGeneralizedDistanceRBFKernel.cc.
void PLearn::ScaledGeneralizedDistanceRBFKernel::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 51 of file ScaledGeneralizedDistanceRBFKernel.cc.
References a, and PLearn::deepCopyField().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(phi, copies); deepCopyField(a, copies); }
Reimplemented from PLearn::Kernel.
Definition at line 69 of file ScaledGeneralizedDistanceRBFKernel.h.
Vec PLearn::ScaledGeneralizedDistanceRBFKernel::a [protected] |
Definition at line 60 of file ScaledGeneralizedDistanceRBFKernel.h.
real PLearn::ScaledGeneralizedDistanceRBFKernel::b [protected] |
Definition at line 59 of file ScaledGeneralizedDistanceRBFKernel.h.
real PLearn::ScaledGeneralizedDistanceRBFKernel::c [protected] |
Definition at line 59 of file ScaledGeneralizedDistanceRBFKernel.h.
Vec PLearn::ScaledGeneralizedDistanceRBFKernel::phi [protected] |
Definition at line 60 of file ScaledGeneralizedDistanceRBFKernel.h.
Referenced by declareOptions().