#include <PLS.h>
Inheritance diagram for PLearn::PLS:
Public Types | |
typedef PLearner | inherited |
Public Member Functions | |
PLS () | |
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 (PLS) | |
virtual int | outputsize () const |
Returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options). | |
virtual void | forget () |
(Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!). | |
virtual void | train () |
The role of the train method is to bring the learner up to stage==nstages, updating the train_stats collector with training costs measured on-line in the process. | |
virtual void | computeOutput (const Vec &input, Vec &output) const |
Computes the output from the input. | |
virtual void | computeCostsFromOutputs (const Vec &input, const Vec &output, const Vec &target, Vec &costs) const |
Computes the costs from already computed output. | |
virtual TVec< string > | getTestCostNames () const |
Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method). | |
virtual TVec< string > | getTrainCostNames () const |
Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats. | |
Static Public Member Functions | |
void | NIPALSEigenvector (const Mat &m, Vec &v, real precision) |
Compute the largest eigenvector of m with the NIPALS algorithm: (1) v <- random initialization (but normalized) (2) v = m.v, normalize v (3) if there is a v[i] that has changed by more than 'preicision', go to (2), otherwise return v. | |
Public Attributes | |
int | k |
string | method |
real | precision |
bool | output_the_score |
bool | output_the_target |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
Declares this class' options. | |
Protected Attributes | |
Mat | B |
int | m |
Vec | mean_input |
Vec | mean_target |
int | p |
Vec | stddev_input |
Vec | stddev_target |
Mat | W |
Private Member Functions | |
void | build_ () |
This does the actual building. |
|
Reimplemented from PLearn::PLearner. |
|
Definition at line 53 of file PLS.cc. References k. |
|
Simply calls inherited::build() then build_().
Reimplemented from PLearn::PLearner. Definition at line 180 of file PLS.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::PLearner. Definition at line 189 of file PLS.cc. References m, mean_input, mean_target, method, output_the_score, output_the_target, p, PLERROR, PLWARNING, PLearn::TVec< T >::resize(), stddev_input, and stddev_target. Referenced by build(). |
|
Computes the costs from already computed output.
Implements PLearn::PLearner. |
|
Computes the output from the input.
Implements PLearn::PLearner. Definition at line 231 of file PLS.cc. References B, k, m, mean_input, mean_target, output_the_score, output_the_target, outputsize(), PLERROR, PLWARNING, PLearn::TVec< T >::resize(), stddev_input, stddev_target, PLearn::TVec< T >::subVec(), PLearn::transposeProduct(), W, and PLearn::TMat< T >::width(). |
|
Declares this class' options.
Reimplemented from PLearn::PLearner. Definition at line 126 of file PLS.cc. References PLearn::declareOption(), and PLearn::OptionList. |
|
(Re-)initializes the PLearner in its fresh state (that state may depend on the 'seed' option) And sets 'stage' back to 0 (this is the stage of a fresh learner!).
Implements PLearn::PLearner. Definition at line 265 of file PLS.cc. References B, PLearn::Mat, and W. |
|
Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).
Implements PLearn::PLearner. |
|
Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats.
Implements PLearn::PLearner. |
|
Transforms a shallow copy into a deep copy.
Definition at line 296 of file PLS.cc. References B, PLearn::deepCopyField(), mean_input, mean_target, stddev_input, stddev_target, and W. |
|
Compute the largest eigenvector of m with the NIPALS algorithm: (1) v <- random initialization (but normalized) (2) v = m.v, normalize v (3) if there is a v[i] that has changed by more than 'preicision', go to (2), otherwise return v.
Definition at line 315 of file PLS.cc. References PLearn::TMat< T >::column(), PLearn::TVec< T >::length(), PLearn::normalize(), and PLearn::product(). Referenced by train(). |
|
Returns the size of this learner's output, (which typically may depend on its inputsize(), targetsize() and set options).
Implements PLearn::PLearner. Definition at line 337 of file PLS.cc. References k, m, output_the_score, and output_the_target. Referenced by computeOutput(). |
|
|
|
The role of the train method is to bring the learner up to stage==nstages, updating the train_stats collector with training costs measured on-line in the process.
Implements PLearn::PLearner. Definition at line 354 of file PLS.cc. References PLearn::abs(), B, PLearn::Var::column(), PLearn::TMat< T >::column(), PLearn::dist(), PLearn::dot(), PLearn::endl(), PLearn::TMat< T >::fill(), PLearn::invertElements(), k, PLearn::TVec< T >::length(), PLearn::VMat::length(), m, mean_input, mean_target, method, PLearn::negateElements(), NIPALSEigenvector(), PLearn::normalize(), PLearn::P(), p, precision, PLearn::product(), PLearn::productTranspose(), PLearn::TMat< T >::resize(), stddev_input, stddev_target, PLearn::SVD(), PLearn::VMat::toMat(), PLearn::transposeProduct(), PLearn::ProgressBar::update(), and W. |
|
Definition at line 64 of file PLS.h. Referenced by computeOutput(), forget(), makeDeepCopyFromShallowCopy(), and train(). |
|
Definition at line 79 of file PLS.h. Referenced by computeOutput(), outputsize(), and train(). |
|
Definition at line 65 of file PLS.h. Referenced by build_(), computeOutput(), outputsize(), and train(). |
|
Definition at line 66 of file PLS.h. Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train(). |
|
Definition at line 67 of file PLS.h. Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train(). |
|
|
|
Definition at line 82 of file PLS.h. Referenced by build_(), computeOutput(), and outputsize(). |
|
Definition at line 83 of file PLS.h. Referenced by build_(), computeOutput(), and outputsize(). |
|
|
|
Definition at line 81 of file PLS.h. Referenced by train(). |
|
Definition at line 69 of file PLS.h. Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train(). |
|
Definition at line 70 of file PLS.h. Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train(). |
|
Definition at line 71 of file PLS.h. Referenced by computeOutput(), forget(), makeDeepCopyFromShallowCopy(), and train(). |