PLearn 0.1
|
returns exp(-(sum_i[abs(x1_i - x2_i)*phi_i])) More...
#include <ScaledLaplacianKernel.h>
Public Member Functions | |
ScaledLaplacianKernel () | |
ScaledLaplacianKernel (Vec the_phi) | |
virtual string | classname () const |
virtual OptionList & | getOptionList () const |
virtual OptionMap & | getOptionMap () const |
virtual RemoteMethodMap & | getRemoteMethodMap () const |
virtual ScaledLaplacianKernel * | 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_ |
Protected Attributes | |
Vec | phi |
Private Types | |
typedef Kernel | inherited |
returns exp(-(sum_i[abs(x1_i - x2_i)*phi_i]))
Definition at line 54 of file ScaledLaplacianKernel.h.
typedef Kernel PLearn::ScaledLaplacianKernel::inherited [private] |
Reimplemented from PLearn::Kernel.
Definition at line 56 of file ScaledLaplacianKernel.h.
PLearn::ScaledLaplacianKernel::ScaledLaplacianKernel | ( | ) | [inline] |
Definition at line 61 of file ScaledLaplacianKernel.h.
: phi() {}
PLearn::ScaledLaplacianKernel::ScaledLaplacianKernel | ( | Vec | the_phi | ) | [inline] |
Definition at line 63 of file ScaledLaplacianKernel.h.
: phi(the_phi) {}
string PLearn::ScaledLaplacianKernel::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledLaplacianKernel.cc.
OptionList & PLearn::ScaledLaplacianKernel::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledLaplacianKernel.cc.
RemoteMethodMap & PLearn::ScaledLaplacianKernel::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledLaplacianKernel.cc.
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledLaplacianKernel.cc.
Object * PLearn::ScaledLaplacianKernel::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledLaplacianKernel.cc.
StaticInitializer ScaledLaplacianKernel::_static_initializer_ & PLearn::ScaledLaplacianKernel::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledLaplacianKernel.cc.
string PLearn::ScaledLaplacianKernel::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledLaplacianKernel.cc.
static const PPath& PLearn::ScaledLaplacianKernel::declaringFile | ( | ) | [inline, static] |
Reimplemented from PLearn::Kernel.
Definition at line 67 of file ScaledLaplacianKernel.h.
ScaledLaplacianKernel * PLearn::ScaledLaplacianKernel::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::Kernel.
Definition at line 49 of file ScaledLaplacianKernel.cc.
** Subclasses must override this method **
returns K(x1,x2)
Implements PLearn::Kernel.
Definition at line 57 of file ScaledLaplacianKernel.cc.
References PLearn::TVec< T >::data(), PLearn::exp(), i, PLearn::TVec< T >::length(), n, and PLERROR.
{ #ifdef BOUNDCHECK if(x1.length()!=x2.length() || x1.length()!=phi.length()) PLERROR("IN ScaledLaplacianKernel::evaluate x1 and x2 and phi must have the same length"); #endif real summ = 0.0; real* v1=x1.data(); real* v2=x2.data(); real* ph=phi.data(); int n=x1.length(); for(int i=0; i<n; i++) summ += fabs(v1[i]-v2[i])*ph[i]; return exp(-summ); }
OptionList & PLearn::ScaledLaplacianKernel::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledLaplacianKernel.cc.
OptionMap & PLearn::ScaledLaplacianKernel::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledLaplacianKernel.cc.
RemoteMethodMap & PLearn::ScaledLaplacianKernel::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::Object.
Definition at line 49 of file ScaledLaplacianKernel.cc.
void PLearn::ScaledLaplacianKernel::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 ScaledLaplacianKernel.cc.
References PLearn::deepCopyField().
{ inherited::makeDeepCopyFromShallowCopy(copies); deepCopyField(phi, copies); }
Reimplemented from PLearn::Kernel.
Definition at line 67 of file ScaledLaplacianKernel.h.
Vec PLearn::ScaledLaplacianKernel::phi [protected] |
Definition at line 59 of file ScaledLaplacianKernel.h.