#include <DivisiveNormalizationKernel.h>
Inheritance diagram for PLearn::DivisiveNormalizationKernel:
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. |
|
Reimplemented from PLearn::SourceKernel. Definition at line 57 of file DivisiveNormalizationKernel.h. |
|
Default constructor.
Definition at line 52 of file DivisiveNormalizationKernel.cc. |
|
Created from an existing kernel.
Definition at line 57 of file DivisiveNormalizationKernel.cc. References build(). |
|
Simply calls inherited::build() then build_().
Reimplemented from PLearn::SourceKernel. Definition at line 103 of file DivisiveNormalizationKernel.cc. References build_(). Referenced by DivisiveNormalizationKernel(). |
|
This does the actual building.
Reimplemented from PLearn::SourceKernel. Definition at line 112 of file DivisiveNormalizationKernel.cc. Referenced by build(). |
|
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(). |
|
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. |
|
Declares this class' options.
Reimplemented from PLearn::SourceKernel. Definition at line 77 of file DivisiveNormalizationKernel.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
Overridden.
Reimplemented from PLearn::SourceKernel. Definition at line 147 of file DivisiveNormalizationKernel.cc. References computeAverage(), and PLearn::sqrt(). |
|
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(). |
|
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. |
|
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. |
|
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. |
|
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. |
|
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::SourceKernel. Definition at line 201 of file DivisiveNormalizationKernel.cc. References PLERROR. |
|
|
|
** 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(). |
|
Used to store the values of the source kernel.
Definition at line 60 of file DivisiveNormalizationKernel.h. Referenced by computeAverage(). |
|
Definition at line 68 of file DivisiveNormalizationKernel.h. Referenced by evaluate_i_j(), evaluate_x_i(), evaluate_x_i_again(), and setDataForKernelMatrix(). |
|
Definition at line 69 of file DivisiveNormalizationKernel.h. Referenced by evaluate_i_j(), evaluate_i_x(), evaluate_i_x_again(), and setDataForKernelMatrix(). |
|
The last average computed in evaluate_i_x_again().
Definition at line 74 of file DivisiveNormalizationKernel.h. Referenced by evaluate_i_x_again(). |
|
The last average computed in evaluate_x_i_again().
Definition at line 77 of file DivisiveNormalizationKernel.h. Referenced by evaluate_x_i_again(). |
|
Definition at line 85 of file DivisiveNormalizationKernel.h. Referenced by setDataForKernelMatrix(). |
|
Definition at line 86 of file DivisiveNormalizationKernel.h. Referenced by setDataForKernelMatrix(). |