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

PLearn::PLS Class Reference

#include <PLS.h>

Inheritance diagram for PLearn::PLS:

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

Collaboration graph
[legend]
List of all members.

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< stringgetTestCostNames () const
 Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).

virtual TVec< stringgetTrainCostNames () 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.


Member Typedef Documentation

typedef PLearner PLearn::PLS::inherited
 

Reimplemented from PLearn::PLearner.

Definition at line 56 of file PLS.h.


Constructor & Destructor Documentation

PLearn::PLS::PLS  ) 
 

Definition at line 53 of file PLS.cc.

References k.


Member Function Documentation

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

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

Reimplemented from PLearn::PLearner.

Definition at line 180 of file PLS.cc.

References build_().

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

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().

void PLearn::PLS::computeCostsFromOutputs const Vec input,
const Vec output,
const Vec target,
Vec costs
const [virtual]
 

Computes the costs from already computed output.

Implements PLearn::PLearner.

Definition at line 222 of file PLS.cc.

void PLearn::PLS::computeOutput const Vec input,
Vec output
const [virtual]
 

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().

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

Declares this class' options.

Reimplemented from PLearn::PLearner.

Definition at line 126 of file PLS.cc.

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

void PLearn::PLS::forget  )  [virtual]
 

(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.

TVec< string > PLearn::PLS::getTestCostNames  )  const [virtual]
 

Returns the names of the costs computed by computeCostsFromOutpus (and thus the test method).

Implements PLearn::PLearner.

Definition at line 276 of file PLS.cc.

TVec< string > PLearn::PLS::getTrainCostNames  )  const [virtual]
 

Returns the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats.

Implements PLearn::PLearner.

Definition at line 286 of file PLS.cc.

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

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.

void PLearn::PLS::NIPALSEigenvector const Mat m,
Vec v,
real  precision
[static]
 

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().

int PLearn::PLS::outputsize  )  const [virtual]
 

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().

PLearn::PLS::PLEARN_DECLARE_OBJECT PLS   ) 
 

void PLearn::PLS::train  )  [virtual]
 

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.


Member Data Documentation

Mat PLearn::PLS::B [protected]
 

Definition at line 64 of file PLS.h.

Referenced by computeOutput(), forget(), makeDeepCopyFromShallowCopy(), and train().

int PLearn::PLS::k
 

Definition at line 79 of file PLS.h.

Referenced by computeOutput(), outputsize(), and train().

int PLearn::PLS::m [protected]
 

Definition at line 65 of file PLS.h.

Referenced by build_(), computeOutput(), outputsize(), and train().

Vec PLearn::PLS::mean_input [protected]
 

Definition at line 66 of file PLS.h.

Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train().

Vec PLearn::PLS::mean_target [protected]
 

Definition at line 67 of file PLS.h.

Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train().

string PLearn::PLS::method
 

Definition at line 80 of file PLS.h.

Referenced by build_(), and train().

bool PLearn::PLS::output_the_score
 

Definition at line 82 of file PLS.h.

Referenced by build_(), computeOutput(), and outputsize().

bool PLearn::PLS::output_the_target
 

Definition at line 83 of file PLS.h.

Referenced by build_(), computeOutput(), and outputsize().

int PLearn::PLS::p [protected]
 

Definition at line 68 of file PLS.h.

Referenced by build_(), and train().

real PLearn::PLS::precision
 

Definition at line 81 of file PLS.h.

Referenced by train().

Vec PLearn::PLS::stddev_input [protected]
 

Definition at line 69 of file PLS.h.

Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train().

Vec PLearn::PLS::stddev_target [protected]
 

Definition at line 70 of file PLS.h.

Referenced by build_(), computeOutput(), makeDeepCopyFromShallowCopy(), and train().

Mat PLearn::PLS::W [protected]
 

Definition at line 71 of file PLS.h.

Referenced by computeOutput(), forget(), makeDeepCopyFromShallowCopy(), and train().


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