PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Private Types
PLearn::GaussianDensityKernel Class Reference

#include <GaussianDensityKernel.h>

Inheritance diagram for PLearn::GaussianDensityKernel:
Inheritance graph
[legend]
Collaboration diagram for PLearn::GaussianDensityKernel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GaussianDensityKernel ()
 GaussianDensityKernel (real the_sigma)
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual GaussianDensityKerneldeepCopy (CopiesMap &copies) const
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 PPathdeclaringFile ()

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

real sigma

Private Types

typedef Kernel inherited

Detailed Description

Like GaussianKernel but the result is properly normalized as a density. returns exp(-0.5*norm_2(x1-x2)^2/sigma^2)/(sigma*sqrt(2pi))^n where n=x1.length().

Definition at line 58 of file GaussianDensityKernel.h.


Member Typedef Documentation

Reimplemented from PLearn::Kernel.

Definition at line 60 of file GaussianDensityKernel.h.


Constructor & Destructor Documentation

PLearn::GaussianDensityKernel::GaussianDensityKernel ( ) [inline]

Definition at line 65 of file GaussianDensityKernel.h.

        : sigma() {}
PLearn::GaussianDensityKernel::GaussianDensityKernel ( real  the_sigma) [inline]

Definition at line 67 of file GaussianDensityKernel.h.

        : sigma(the_sigma) {}

Member Function Documentation

string PLearn::GaussianDensityKernel::_classname_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file GaussianDensityKernel.cc.

OptionList & PLearn::GaussianDensityKernel::_getOptionList_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file GaussianDensityKernel.cc.

RemoteMethodMap & PLearn::GaussianDensityKernel::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file GaussianDensityKernel.cc.

bool PLearn::GaussianDensityKernel::_isa_ ( const Object o) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file GaussianDensityKernel.cc.

Object * PLearn::GaussianDensityKernel::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 51 of file GaussianDensityKernel.cc.

StaticInitializer GaussianDensityKernel::_static_initializer_ & PLearn::GaussianDensityKernel::_static_initialize_ ( ) [static]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file GaussianDensityKernel.cc.

string PLearn::GaussianDensityKernel::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file GaussianDensityKernel.cc.

void PLearn::GaussianDensityKernel::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);
  }
Parameters:
olList of options that is progressively being constructed for the current class.

Reimplemented from PLearn::Kernel.

Definition at line 56 of file GaussianDensityKernel.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), and sigma.

Here is the call graph for this function:

static const PPath& PLearn::GaussianDensityKernel::declaringFile ( ) [inline, static]

Reimplemented from PLearn::Kernel.

Definition at line 70 of file GaussianDensityKernel.h.

:
    static void declareOptions(OptionList& ol);
GaussianDensityKernel * PLearn::GaussianDensityKernel::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::Kernel.

Definition at line 51 of file GaussianDensityKernel.cc.

real PLearn::GaussianDensityKernel::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 GaussianDensityKernel.cc.

References PLearn::exp(), PLearn::TVec< T >::length(), Log2Pi, pl_log, and PLearn::powdistance().

{ return exp(-real(0.5)*powdistance(x1, x2, real(2.0))/(sigma*sigma) - x1.length()*(0.5*Log2Pi + pl_log(sigma))); }

Here is the call graph for this function:

OptionList & PLearn::GaussianDensityKernel::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file GaussianDensityKernel.cc.

OptionMap & PLearn::GaussianDensityKernel::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file GaussianDensityKernel.cc.

RemoteMethodMap & PLearn::GaussianDensityKernel::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 51 of file GaussianDensityKernel.cc.


Member Data Documentation

Reimplemented from PLearn::Kernel.

Definition at line 70 of file GaussianDensityKernel.h.

Definition at line 63 of file GaussianDensityKernel.h.

Referenced by declareOptions().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines