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

PLearn::EmbeddedSequentialLearner Class Reference

#include <EmbeddedSequentialLearner.h>

Inheritance diagram for PLearn::EmbeddedSequentialLearner:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 EmbeddedSequentialLearner ()
 Constructor.

virtual void build ()
 simply calls inherited::build() then build_()

virtual void train ()
 Does the actual training.

virtual void test (VMat testset, PP< VecStatsCollector > test_stats, VMat testoutputs=0, VMat testcosts=0) const
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.

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 computeOutput (const Vec &input, Vec &output)
virtual void computeCostsFromOutputs (const Vec &input, const Vec &output, const Vec &target, Vec &costs)
virtual void computeOutputAndCosts (const Vec &input, const Vec &target, Vec &output, Vec &costs)
virtual void computeCostsOnly (const Vec &input, const Vec &target, Vec &costs)
virtual TVec< stringgetTestCostNames () const
 *** SUBCLASS WRITING: *** This should return the names of the costs computed by computeCostsFromOutpus

virtual TVec< stringgetTrainCostNames () const
 *** SUBCLASS WRITING: *** This should return the names of the objective costs that the train method computes and for which it updates the VecStatsCollector train_stats

 PLEARN_DECLARE_OBJECT (EmbeddedSequentialLearner)
 Declares a few other classes and functions related to this class.


Public Attributes

PP< PLearnerlearner

Static Protected Member Functions

void declareOptions (OptionList &ol)
 Declare this class' options.


Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

This SequentialLearner simply embeddes a Learner that we wish to train sequentially. Most of the methods simply forward the call to the underlying Learner.

Definition at line 51 of file EmbeddedSequentialLearner.h.


Constructor & Destructor Documentation

PLearn::EmbeddedSequentialLearner::EmbeddedSequentialLearner  ) 
 

Constructor.

Definition at line 49 of file EmbeddedSequentialLearner.cc.


Member Function Documentation

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

simply calls inherited::build() then build_()

Reimplemented from PLearn::SequentialLearner.

Definition at line 68 of file EmbeddedSequentialLearner.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::SequentialLearner.

Definition at line 58 of file EmbeddedSequentialLearner.cc.

References forget(), PLearn::PP< PLearner >::isNull(), learner, and PLERROR.

Referenced by build().

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

Definition at line 177 of file EmbeddedSequentialLearner.cc.

References learner.

void PLearn::EmbeddedSequentialLearner::computeCostsOnly const Vec input,
const Vec target,
Vec costs
[virtual]
 

Definition at line 185 of file EmbeddedSequentialLearner.cc.

References learner.

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

Definition at line 174 of file EmbeddedSequentialLearner.cc.

References learner.

void PLearn::EmbeddedSequentialLearner::computeOutputAndCosts const Vec input,
const Vec target,
Vec output,
Vec costs
[virtual]
 

Definition at line 181 of file EmbeddedSequentialLearner.cc.

References learner.

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

Declare this class' options.

Reimplemented from PLearn::SequentialLearner.

Definition at line 74 of file EmbeddedSequentialLearner.cc.

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

void PLearn::EmbeddedSequentialLearner::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!)

*** SUBCLASS WRITING: *** A typical forget() method should do the following:

  • initialize a random number generator with the seed option
  • initialize the learner's parameters, using this random generator
  • stage = 0; This method is typically called by the build_() method, after it has finished setting up the parameters, and if it deemed useful to set or reset the learner in its fresh state. (remember build may be called after modifying options that do not necessarily require the learner to restart from a fresh state...) forget is also called by the setTrainingSet method, after calling build(), so it will generally be called TWICE during setTrainingSet!

Reimplemented from PLearn::SequentialLearner.

Definition at line 168 of file EmbeddedSequentialLearner.cc.

References learner.

Referenced by build_().

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

*** SUBCLASS WRITING: *** This should return the names of the costs computed by computeCostsFromOutpus

Implements PLearn::PLearner.

Definition at line 188 of file EmbeddedSequentialLearner.cc.

References learner.

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

*** SUBCLASS WRITING: *** This should return 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 191 of file EmbeddedSequentialLearner.cc.

References learner.

void PLearn::EmbeddedSequentialLearner::makeDeepCopyFromShallowCopy CopiesMap copies  )  [virtual]
 

Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be.

Reimplemented from PLearn::SequentialLearner.

Definition at line 52 of file EmbeddedSequentialLearner.cc.

References PLearn::CopiesMap, PLearn::deepCopyField(), and learner.

PLearn::EmbeddedSequentialLearner::PLEARN_DECLARE_OBJECT EmbeddedSequentialLearner   ) 
 

Declares a few other classes and functions related to this class.

void PLearn::EmbeddedSequentialLearner::test VMat  testset,
PP< VecStatsCollector test_stats,
VMat  testoutputs = 0,
VMat  testcosts = 0
const [virtual]
 

*** SUBCLASS WRITING: *** The method should:

  • call computeOutputAndCosts on the test set
  • save the outputs and the costs in the predictions & errors matrices, beginning at position last_call_train_t

Implements PLearn::SequentialLearner.

Definition at line 105 of file EmbeddedSequentialLearner.cc.

References PLearn::VMat::getExample(), PLearn::TVec< T >::hasMissing(), learner, PLearn::VMat::length(), MAX, PLearn::SequentialLearner::nTestCosts(), PLearn::SequentialLearner::outputsize(), PLearn::ProgressBar::update(), and PLearn::Vec.

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

Does the actual training.

Implements PLearn::SequentialLearner.

Definition at line 82 of file EmbeddedSequentialLearner.cc.

References PLearn::TmpFilenames::addFilename(), PLearn::filter(), learner, PLearn::VMat::length(), PLearn::max(), PLearn::VMat::subMatRows(), and PLearn::PLearner::targetsize().


Member Data Documentation

PP<PLearner> PLearn::EmbeddedSequentialLearner::learner
 

Definition at line 55 of file EmbeddedSequentialLearner.h.

Referenced by build_(), computeCostsFromOutputs(), computeCostsOnly(), computeOutput(), computeOutputAndCosts(), forget(), getTestCostNames(), getTrainCostNames(), makeDeepCopyFromShallowCopy(), test(), 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