#include <StatefulLearner.h>
Inheritance diagram for PLearn::StatefulLearner:
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. |
|
Reimplemented from PLearn::PLearner. Definition at line 56 of file StatefulLearner.h. |
|
Default constructor.
Definition at line 49 of file StatefulLearner.cc. |
|
Simply calls inherited::build() then build_().
Reimplemented from PLearn::PLearner. Definition at line 64 of file StatefulLearner.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::PLearner. Definition at line 60 of file StatefulLearner.cc. Referenced by build(). |
|
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. |
|
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(). |
|
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. |
|
Computes the outputs and costs simultaneously.
Reimplemented from PLearn::PLearner. Referenced by computeCostsOnly(), and computeOutput(). |
|
Declares this class' options.
Reimplemented from PLearn::PLearner. Definition at line 55 of file StatefulLearner.cc. References PLearn::OptionList. |
|
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(). |
|
Does this PLearner has an internal state? Default: true.
Reimplemented from PLearn::PLearner. Definition at line 116 of file StatefulLearner.cc. |
|
Transforms a shallow copy into a deep copy.
Definition at line 70 of file StatefulLearner.cc. |
|
|
|
Set the time step at which the current test is perform.
Definition at line 113 of file StatefulLearner.cc. References current_test_t. |
|
Set the dataset of an AssetManager (if any) to this testset Default: do nothing!
Definition at line 110 of file StatefulLearner.cc. |
|
Declares the train set.
Reimplemented from PLearn::PLearner. Definition at line 104 of file StatefulLearner.cc. References forget(). |
|
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(). |