#include <KNNVMatrix.h>
Inheritance diagram for PLearn::KNNVMatrix:
Public Member Functions | |
KNNVMatrix () | |
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 (KNNVMatrix) | |
Public Attributes | |
VMat | k_nn_mat |
Ker | kernel_pij |
int | knn |
bool | report_progress |
Protected Member Functions | |
int | getSourceIndexOf (int i, int &i_ref, int &i_n) const |
Return the index in the source matrix of the sample number i in this matrix. | |
int | getTag (int p) const |
Return the tag of the sample number p in a bag: p == 0 => 1 p == knn-1 => 2 otherwise => 0 (If knn == 1, always return 3). | |
virtual void | getNewRow (int i, const Vec &v) const |
Needed because it's a SourceVMatrix. | |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Protected Attributes | |
Mat | nn |
Store the nearest neighbours of each point. | |
Mat | pij |
Store the pij weights, if a kernel_pij is provided. | |
Private Types | |
typedef SourceVMatrix | inherited |
Private Member Functions | |
void | build_ () |
This does the actual building. | |
Private Attributes | |
Vec | source_row |
Used to store a row of the source VMatrix. |
|
Reimplemented from PLearn::SourceVMatrix. Definition at line 58 of file KNNVMatrix.h. |
|
Definition at line 54 of file KNNVMatrix.cc. |
|
simply calls inherited::build() then build_()
Reimplemented from PLearn::SourceVMatrix. Definition at line 102 of file KNNVMatrix.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::SourceVMatrix. Definition at line 111 of file KNNVMatrix.cc. References PLearn::Kernel::build(), PLearn::Kernel::computeGramMatrix(), PLearn::Kernel::computeNeighbourMatrixFromDistanceMatrix(), PLearn::VMat::getSubRow(), PLearn::PP< T >::isNull(), k, k_nn_mat, kernel_pij, knn, PLearn::TVec< T >::length(), PLearn::VMat::length(), nn, pij, PLERROR, PLWARNING, PLearn::Kernel::report_progress, report_progress, PLearn::TMat< T >::resize(), PLearn::TMat< T >::row(), PLearn::DistanceKernel::setDataForKernelMatrix(), PLearn::SourceVMatrix::setMetaInfoFromSource(), PLearn::sum(), and PLearn::VMat::width(). Referenced by build(). |
|
Declares this class' options.
Reimplemented from PLearn::SourceVMatrix. Definition at line 75 of file KNNVMatrix.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
Needed because it's a SourceVMatrix.
Reimplemented from PLearn::SourceVMatrix. Definition at line 304 of file KNNVMatrix.cc. References getSourceIndexOf(), getTag(), PLearn::VMatrix::inputsize(), kernel_pij, pij, PLearn::TVec< T >::resize(), source_row, PLearn::TVec< T >::subVec(), PLearn::VMatrix::targetsize(), PLearn::VMatrix::weightsize(), and PLearn::VMat::width(). |
|
Return the index in the source matrix of the sample number i in this matrix. Also return in i_n the neighbour rank, and in i_ref the reference point. Definition at line 294 of file KNNVMatrix.cc. Referenced by getNewRow(). |
|
Return the tag of the sample number p in a bag: p == 0 => 1 p == knn-1 => 2 otherwise => 0 (If knn == 1, always return 3).
Definition at line 333 of file KNNVMatrix.cc. References knn. Referenced by getNewRow(). |
|
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::SourceVMatrix. Definition at line 268 of file KNNVMatrix.cc. References PLearn::deepCopyField(), kernel_pij, nn, pij, PLWARNING, and source_row. |
|
|
|
Definition at line 82 of file KNNVMatrix.h. Referenced by build_(). |
|
Definition at line 83 of file KNNVMatrix.h. Referenced by build_(), getNewRow(), and makeDeepCopyFromShallowCopy(). |
|
Definition at line 84 of file KNNVMatrix.h. Referenced by build_(), getSourceIndexOf(), and getTag(). |
|
Store the nearest neighbours of each point.
Definition at line 71 of file KNNVMatrix.h. Referenced by build_(), getSourceIndexOf(), and makeDeepCopyFromShallowCopy(). |
|
Store the pij weights, if a kernel_pij is provided.
Definition at line 74 of file KNNVMatrix.h. Referenced by build_(), getNewRow(), and makeDeepCopyFromShallowCopy(). |
|
Definition at line 85 of file KNNVMatrix.h. Referenced by build_(). |
|
Used to store a row of the source VMatrix.
Definition at line 61 of file KNNVMatrix.h. Referenced by getNewRow(), and makeDeepCopyFromShallowCopy(). |