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

PLearn::StatefulLearner Class Reference

#include <StatefulLearner.h>

Inheritance diagram for PLearn::StatefulLearner:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StatefulLearner ()
 Default constructor.

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_ABSTRACT_OBJECT (StatefulLearner)
virtual void forget ()=0
 Forget still needs to be redefined in derived classes, but the implementation here performs a no-op.

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 void computeOutputAndCosts (const Vec &input, const Vec &target, Vec &output, Vec &costs) const =0
 Computes the outputs and costs simultaneously.

virtual void computeCostsOnly (const Vec &input, const Vec &target, Vec &costs) const
 Computes the costs from the input and target vectors Simply calls computeOutputAndCosts(...).

virtual void setTrainingSet (VMat training_set, bool call_forget=true)
 Declares the train set.

virtual bool isStatefulLearner () const
 Does this PLearner has an internal state? Default: true.

virtual void setTestSet (VMat testset)
 Set the dataset of an AssetManager (if any) to this testset Default: do nothing!

virtual void setCurrentTestTime (int test_t)
 Set the time step at which the current test is perform.


Static Protected Member Functions

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


Protected Attributes

int current_test_t
 Time step at which the current test is perform This can be useful when entering computeOutputAndCosts(...) method.


Private Types

typedef PLearner inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef PLearner PLearn::StatefulLearner::inherited [private]
 

Reimplemented from PLearn::PLearner.

Definition at line 56 of file StatefulLearner.h.


Constructor & Destructor Documentation

PLearn::StatefulLearner::StatefulLearner  ) 
 

Default constructor.

Definition at line 49 of file StatefulLearner.cc.


Member Function Documentation

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

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

Reimplemented from PLearn::PLearner.

Definition at line 64 of file StatefulLearner.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::PLearner.

Definition at line 60 of file StatefulLearner.cc.

Referenced by build().

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

Computes the costs from already computed output.

This has no sense for a StatefulLearner since we suppose that the output and costs are computed together from the SAME state!

Implements PLearn::PLearner.

Definition at line 89 of file StatefulLearner.cc.

References PLERROR.

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

Computes the costs from the input and target vectors Simply calls computeOutputAndCosts(...).

Reimplemented from PLearn::PLearner.

Definition at line 95 of file StatefulLearner.cc.

References computeOutputAndCosts(), PLearn::PLearner::outputsize(), PLWARNING, and PLearn::TVec< T >::resize().

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

Computes the output from the input.

Simply calls computeOutputAndCosts(...)

Implements PLearn::PLearner.

Definition at line 78 of file StatefulLearner.cc.

References computeOutputAndCosts(), PLearn::PLearner::nTestCosts(), PLWARNING, PLearn::TVec< T >::resize(), PLearn::PLearner::targetsize(), and PLearn::Vec.

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

Computes the outputs and costs simultaneously.

Reimplemented from PLearn::PLearner.

Referenced by computeCostsOnly(), and computeOutput().

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

Declares this class' options.

Reimplemented from PLearn::PLearner.

Definition at line 55 of file StatefulLearner.cc.

References PLearn::OptionList.

void PLearn::StatefulLearner::forget  )  [pure virtual]
 

Forget still needs to be redefined in derived classes, but the implementation here performs a no-op.

This allows derived classes to write inherited::forget() without fear.

Implements PLearn::PLearner.

Definition at line 75 of file StatefulLearner.cc.

Referenced by setTrainingSet().

bool PLearn::StatefulLearner::isStatefulLearner  )  const [virtual]
 

Does this PLearner has an internal state? Default: true.

Reimplemented from PLearn::PLearner.

Definition at line 116 of file StatefulLearner.cc.

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

Transforms a shallow copy into a deep copy.

Definition at line 70 of file StatefulLearner.cc.

PLearn::StatefulLearner::PLEARN_DECLARE_ABSTRACT_OBJECT StatefulLearner   ) 
 

void PLearn::StatefulLearner::setCurrentTestTime int  test_t  )  [virtual]
 

Set the time step at which the current test is perform.

Definition at line 113 of file StatefulLearner.cc.

References current_test_t.

void PLearn::StatefulLearner::setTestSet VMat  testset  )  [virtual]
 

Set the dataset of an AssetManager (if any) to this testset Default: do nothing!

Definition at line 110 of file StatefulLearner.cc.

void PLearn::StatefulLearner::setTrainingSet VMat  training_set,
bool  call_forget = true
[virtual]
 

Declares the train set.

Reimplemented from PLearn::PLearner.

Definition at line 104 of file StatefulLearner.cc.

References forget().


Member Data Documentation

int PLearn::StatefulLearner::current_test_t [protected]
 

Time step at which the current test is perform This can be useful when entering computeOutputAndCosts(...) method.

Definition at line 62 of file StatefulLearner.h.

Referenced by setCurrentTestTime().


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