#include <PrecomputedKernel.h>
Inheritance diagram for PLearn::PrecomputedKernel:
Public Member Functions | |
PrecomputedKernel () | |
PrecomputedKernel (Ker the_ker) | |
virtual void | build () |
Should call simply inherited::build(), then this class's build_(). | |
PLEARN_DECLARE_OBJECT (PrecomputedKernel) | |
virtual void | makeDeepCopyFromShallowCopy (map< const void *, void * > &copies) |
virtual void | setDataForKernelMatrix (VMat the_data) |
This method precomputes and stores all kernel values. | |
virtual void | addDataForKernelMatrix (const Vec &newRow) |
virtual real | evaluate (const Vec &x1, const Vec &x2) const |
returns K(x1,x2) | |
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 |
returns evaluate(data(i),x) | |
virtual real | evaluate_x_i (const Vec &x, int i, real squared_norm_of_x=-1) const |
returns evaluate(x,data(i)) | |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) | |
Protected Attributes | |
Ker | ker |
the real underlying kernel | |
TVec< Vec > | precomputedK |
the precomputed kernel matrix | |
Private Types | |
typedef Kernel | inherited |
Private Member Functions | |
void | build_ () |
Definition at line 54 of file PrecomputedKernel.h.
|
Reimplemented from PLearn::Kernel. Definition at line 56 of file PrecomputedKernel.h. |
|
Definition at line 70 of file PrecomputedKernel.h. |
|
Definition at line 73 of file PrecomputedKernel.h. References ker. |
|
This method is meant to be used any time the data matrix is appended a new row by an outer instance (e.g. SequentialKernel). Through this method, the kernel must update any data dependent internal structure. The internal structures should have consistent length with the data matrix, assuming a sequential growing of the vmat. Reimplemented from PLearn::Kernel. Definition at line 86 of file PrecomputedKernel.h. References addDataForKernelMatrix(), and PLERROR. Referenced by addDataForKernelMatrix(). |
|
Should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object. Reimplemented from PLearn::Kernel. Definition at line 64 of file PrecomputedKernel.cc. References build_(). |
|
This method should be redefined in subclasses and do the actual building of the object according to previously set option fields. Constructors can just set option fields, and then call build_. This method is NOT virtual, and will typically be called only from three places: a constructor, the public virtual build() method, and possibly the public virtual read method (which calls its parent's read). build_() can assume that it's parent's build_ has already been called. Reimplemented from PLearn::Kernel. Definition at line 60 of file PrecomputedKernel.cc. Referenced by build(). |
|
redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down) ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); } Reimplemented from PLearn::Kernel. Definition at line 150 of file PrecomputedKernel.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
returns K(x1,x2)
Implements PLearn::Kernel. Definition at line 126 of file PrecomputedKernel.cc. References ker, and PLearn::Vec. |
|
returns evaluate(data(i),data(j))
Reimplemented from PLearn::Kernel. Definition at line 130 of file PrecomputedKernel.cc. References PLearn::TVec< Vec >::isNull(), PLearn::VMat::length(), PLERROR, and precomputedK. |
|
returns evaluate(data(i),x)
Reimplemented from PLearn::Kernel. Definition at line 143 of file PrecomputedKernel.cc. |
|
returns evaluate(x,data(i))
Reimplemented from PLearn::Kernel. Definition at line 147 of file PrecomputedKernel.cc. |
|
Definition at line 72 of file PrecomputedKernel.cc. References PLearn::deepCopyField(), ker, and precomputedK. |
|
|
|
This method precomputes and stores all kernel values.
Reimplemented from PLearn::Kernel. Definition at line 104 of file PrecomputedKernel.cc. References ker, PLearn::VMat::length(), precomputedK, and PLearn::TVec< Vec >::resize(). |
|
the real underlying kernel
Definition at line 59 of file PrecomputedKernel.h. Referenced by evaluate(), evaluate_i_x(), evaluate_x_i(), makeDeepCopyFromShallowCopy(), PrecomputedKernel(), and setDataForKernelMatrix(). |
|
the precomputed kernel matrix
Definition at line 60 of file PrecomputedKernel.h. Referenced by evaluate_i_j(), makeDeepCopyFromShallowCopy(), and setDataForKernelMatrix(). |