Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::DivisiveNormalizationKernel Class Reference

#include <DivisiveNormalizationKernel.h>

Inheritance diagram for PLearn::DivisiveNormalizationKernel:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DivisiveNormalizationKernel ()
 Default constructor.

 DivisiveNormalizationKernel (Ker the_source, bool the_remove_bias=false)
 Created from an existing kernel.

virtual void build ()
 Simply calls inherited::build() then build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
 Transforms a shallow copy into a deep copy.

 PLEARN_DECLARE_OBJECT (DivisiveNormalizationKernel)
virtual real evaluate (const Vec &x1, const Vec &x2) const
 Overridden.

virtual real evaluate_i_j (int i, int j) const
 returns evaluate(data(i),data(j))

virtual real evaluate_i_x (int i, const Vec &x, real squared_norm_of_x=-1) const
virtual real evaluate_x_i (const Vec &x, int i, real squared_norm_of_x=-1) const
 returns evaluate(x,data(i)) [default version calls evaluate_i_x if kernel is_symmetric]

virtual real evaluate_i_x_again (int i, const Vec &x, real squared_norm_of_x=-1, bool first_time=false) const
 Return evaluate(data(i),x), where x is the same as in the precedent call to this same function (except if 'first_time' is true).

virtual real evaluate_x_i_again (const Vec &x, int i, real squared_norm_of_x=-1, bool first_time=false) const
virtual void computeGramMatrix (Mat K) const
 Call evaluate_i_j to fill each of the entries (i,j) of symmetric matrix K.

virtual void setDataForKernelMatrix (VMat the_data)
 ** Subclasses may overload these methods to provide efficient kernel matrix access **


Public Attributes

bool data_will_change
bool remove_bias

Protected Member Functions

real computeAverage (const Vec &x, bool on_row, real squared_norm_of_x=-1) const
 Return the average of K(x,x_i) or K(x_i,x), depending on the value of 'on_row' (true or false, respectively).


Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declares this class' options.


Protected Attributes

Vec average_col
Vec average_row
real avg_evaluate_i_x_again
 The last average computed in evaluate_i_x_again().

real avg_evaluate_x_i_again
 The last average computed in evaluate_x_i_again().


Private Types

typedef SourceKernel inherited

Private Member Functions

void build_ ()
 This does the actual building.


Private Attributes

Vec all_k_x
 Used to store the values of the source kernel.


Member Typedef Documentation

typedef SourceKernel PLearn::DivisiveNormalizationKernel::inherited [private]
 

Reimplemented from PLearn::SourceKernel.

Definition at line 57 of file DivisiveNormalizationKernel.h.


Constructor & Destructor Documentation

PLearn::DivisiveNormalizationKernel::DivisiveNormalizationKernel  ) 
 

Default constructor.

Definition at line 52 of file DivisiveNormalizationKernel.cc.

PLearn::DivisiveNormalizationKernel::DivisiveNormalizationKernel Ker  the_source,
bool  the_remove_bias = false
 

Created from an existing kernel.

Definition at line 57 of file DivisiveNormalizationKernel.cc.

References build().


Member Function Documentation

void PLearn::DivisiveNormalizationKernel::build  )  [virtual]
 

Simply calls inherited::build() then build_().

Reimplemented from PLearn::SourceKernel.

Definition at line 103 of file DivisiveNormalizationKernel.cc.

References build_().

Referenced by DivisiveNormalizationKernel().

void PLearn::DivisiveNormalizationKernel::build_  )  [private]
 

This does the actual building.

Reimplemented from PLearn::SourceKernel.

Definition at line 112 of file DivisiveNormalizationKernel.cc.

Referenced by build().

real PLearn::DivisiveNormalizationKernel::computeAverage const Vec x,
bool  on_row,
real  squared_norm_of_x = -1
const [inline, protected]
 

Return the average of K(x,x_i) or K(x_i,x), depending on the value of 'on_row' (true or false, respectively).

Definition at line 126 of file DivisiveNormalizationKernel.cc.

References all_k_x, PLearn::TVec< T >::resize(), PLearn::sum(), PLearn::Vec, and x.

Referenced by evaluate(), evaluate_i_x(), evaluate_i_x_again(), evaluate_x_i(), and evaluate_x_i_again().

void PLearn::DivisiveNormalizationKernel::computeGramMatrix Mat  K  )  const [virtual]
 

Call evaluate_i_j to fill each of the entries (i,j) of symmetric matrix K.

Reimplemented from PLearn::SourceKernel.

Definition at line 139 of file DivisiveNormalizationKernel.cc.

References PLearn::Mat.

void PLearn::DivisiveNormalizationKernel::declareOptions OptionList ol  )  [static, protected]
 

Declares this class' options.

Reimplemented from PLearn::SourceKernel.

Definition at line 77 of file DivisiveNormalizationKernel.cc.

References PLearn::declareOption(), and PLearn::OptionList.

real PLearn::DivisiveNormalizationKernel::evaluate const Vec x1,
const Vec x2
const [virtual]
 

Overridden.

Reimplemented from PLearn::SourceKernel.

Definition at line 147 of file DivisiveNormalizationKernel.cc.

References computeAverage(), and PLearn::sqrt().

real PLearn::DivisiveNormalizationKernel::evaluate_i_j int  i,
int  j
const [virtual]
 

returns evaluate(data(i),data(j))

Reimplemented from PLearn::SourceKernel.

Definition at line 156 of file DivisiveNormalizationKernel.cc.

References average_col, average_row, and PLearn::sqrt().

real PLearn::DivisiveNormalizationKernel::evaluate_i_x int  i,
const Vec x,
real  squared_norm_of_x = -1
const [virtual]
 

returns evaluate(data(i),x) [squared_norm_of_x is just a hint that may allow to speed up computation if it is already known, but it's optional]

Reimplemented from PLearn::SourceKernel.

Definition at line 163 of file DivisiveNormalizationKernel.cc.

References average_row, computeAverage(), PLearn::sqrt(), and x.

real PLearn::DivisiveNormalizationKernel::evaluate_i_x_again int  i,
const Vec x,
real  squared_norm_of_x = -1,
bool  first_time = false
const [virtual]
 

Return evaluate(data(i),x), where x is the same as in the precedent call to this same function (except if 'first_time' is true).

This can be used to speed up successive computations of K(x_i, x) (default version just calls evaluate_i_x).

Reimplemented from PLearn::Kernel.

Definition at line 171 of file DivisiveNormalizationKernel.cc.

References average_row, avg_evaluate_i_x_again, computeAverage(), PLearn::sqrt(), and x.

real PLearn::DivisiveNormalizationKernel::evaluate_x_i const Vec x,
int  i,
real  squared_norm_of_x = -1
const [virtual]
 

returns evaluate(x,data(i)) [default version calls evaluate_i_x if kernel is_symmetric]

Reimplemented from PLearn::SourceKernel.

Definition at line 182 of file DivisiveNormalizationKernel.cc.

References average_col, computeAverage(), PLearn::sqrt(), and x.

real PLearn::DivisiveNormalizationKernel::evaluate_x_i_again const Vec x,
int  i,
real  squared_norm_of_x = -1,
bool  first_time = false
const [virtual]
 

Reimplemented from PLearn::Kernel.

Definition at line 190 of file DivisiveNormalizationKernel.cc.

References average_col, avg_evaluate_x_i_again, computeAverage(), PLearn::sqrt(), and x.

void PLearn::DivisiveNormalizationKernel::makeDeepCopyFromShallowCopy map< const void *, void * > &  copies  )  [virtual]
 

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::SourceKernel.

Definition at line 201 of file DivisiveNormalizationKernel.cc.

References PLERROR.

PLearn::DivisiveNormalizationKernel::PLEARN_DECLARE_OBJECT DivisiveNormalizationKernel   ) 
 

void PLearn::DivisiveNormalizationKernel::setDataForKernelMatrix VMat  the_data  )  [virtual]
 

** Subclasses may overload these methods to provide efficient kernel matrix access **

This method sets the data VMat that will be used to define the kernel matrix. It may precompute values from this that may later accelerate the evaluation of a kernel matrix element

Reimplemented from PLearn::SourceKernel.

Definition at line 218 of file DivisiveNormalizationKernel.cc.

References average_col, average_row, data_will_change, PLearn::TVec< T >::fill(), PLearn::TVec< T >::length(), PLearn::VMat::length(), remove_bias, and PLearn::TVec< T >::resize().


Member Data Documentation

Vec PLearn::DivisiveNormalizationKernel::all_k_x [mutable, private]
 

Used to store the values of the source kernel.

Definition at line 60 of file DivisiveNormalizationKernel.h.

Referenced by computeAverage().

Vec PLearn::DivisiveNormalizationKernel::average_col [protected]
 

Definition at line 68 of file DivisiveNormalizationKernel.h.

Referenced by evaluate_i_j(), evaluate_x_i(), evaluate_x_i_again(), and setDataForKernelMatrix().

Vec PLearn::DivisiveNormalizationKernel::average_row [protected]
 

Definition at line 69 of file DivisiveNormalizationKernel.h.

Referenced by evaluate_i_j(), evaluate_i_x(), evaluate_i_x_again(), and setDataForKernelMatrix().

real PLearn::DivisiveNormalizationKernel::avg_evaluate_i_x_again [mutable, protected]
 

The last average computed in evaluate_i_x_again().

Definition at line 74 of file DivisiveNormalizationKernel.h.

Referenced by evaluate_i_x_again().

real PLearn::DivisiveNormalizationKernel::avg_evaluate_x_i_again [mutable, protected]
 

The last average computed in evaluate_x_i_again().

Definition at line 77 of file DivisiveNormalizationKernel.h.

Referenced by evaluate_x_i_again().

bool PLearn::DivisiveNormalizationKernel::data_will_change
 

Definition at line 85 of file DivisiveNormalizationKernel.h.

Referenced by setDataForKernelMatrix().

bool PLearn::DivisiveNormalizationKernel::remove_bias
 

Definition at line 86 of file DivisiveNormalizationKernel.h.

Referenced by setDataForKernelMatrix().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:23:24 2004 for PLearn by doxygen 1.3.7