#include <MovingAverage.h>
Inheritance diagram for PLearn::MovingAverage:
Public Types | |
typedef SequentialLearner | inherited |
Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be. | |
Public Member Functions | |
MovingAverage () | |
Constructor. | |
virtual void | build () |
simply calls inherited::build() then build_() | |
virtual void | train () |
virtual void | test (VMat testset, PP< VecStatsCollector > test_stats, VMat testoutputs=0, VMat testcosts=0) const |
virtual void | computeCostsFromOutputs (const Vec &inputs, const Vec &outputs, const Vec &targets, Vec &costs) const |
*** SUBCLASS WRITING: *** This should be defined in subclasses to compute the weighted costs from already computed output. | |
virtual TVec< string > | getTrainCostNames () 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 | |
virtual TVec< string > | getTestCostNames () const |
*** SUBCLASS WRITING: *** This should return the names of the costs computed by computeCostsFromOutpus | |
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!) | |
PLEARN_DECLARE_OBJECT (MovingAverage) | |
Public Attributes | |
int | window_length |
Array< string > | cost_funcs |
Static Protected Member Functions | |
void | declareOptions (OptionList &ol) |
Declare this class' options. | |
Private Member Functions | |
void | build_ () |
This does the actual building. |
This is a memoryless learner!
Definition at line 49 of file MovingAverage.h.
|
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 87 of file MovingAverage.h. |
|
Constructor.
Definition at line 48 of file MovingAverage.cc. |
|
simply calls inherited::build() then build_()
Reimplemented from PLearn::SequentialLearner. Definition at line 64 of file MovingAverage.cc. References build_(). |
|
This does the actual building.
Reimplemented from PLearn::SequentialLearner. Definition at line 52 of file MovingAverage.cc. References cost_funcs, forget(), PLERROR, PLearn::TVec< string >::size(), and window_length. Referenced by build(). |
|
*** SUBCLASS WRITING: *** This should be defined in subclasses to compute the weighted costs from already computed output. The costs should correspond to the cost names returned by getTestCostNames() NOTE: In exotic cases, the cost may also depend on some info in the input, that's why the method also gets so see it. Reimplemented from PLearn::SequentialLearner. Definition at line 183 of file MovingAverage.cc. References cost_funcs, PLERROR, PLearn::TVec< string >::size(), and PLearn::square(). |
|
Declare this class' options.
Reimplemented from PLearn::SequentialLearner. Definition at line 70 of file MovingAverage.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!) *** SUBCLASS WRITING: *** A typical forget() method should do the following:
Reimplemented from PLearn::SequentialLearner. Definition at line 201 of file MovingAverage.cc. Referenced by build_(). |
|
*** SUBCLASS WRITING: *** This should return the names of the costs computed by computeCostsFromOutpus
Implements PLearn::PLearner. Definition at line 198 of file MovingAverage.cc. References getTrainCostNames(). |
|
*** 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 195 of file MovingAverage.cc. References cost_funcs. Referenced by getTestCostNames(). |
|
|
|
*** SUBCLASS WRITING: *** The method should:
Implements PLearn::SequentialLearner. Definition at line 130 of file MovingAverage.cc. References PLearn::columnMean(), computeCostsFromOutputs(), PLearn::endl(), PLearn::VMat::getSubRow(), PLearn::TVec< T >::hasMissing(), PLearn::PLearner::inputsize(), PLearn::VMat::length(), MAX, PLearn::SequentialLearner::outputsize(), PLearn::VMat::subMat(), PLearn::PLearner::targetsize(), PLearn::VMat::toMat(), PLearn::ProgressBar::update(), and window_length. |
|
*** SUBCLASS WRITING: *** Does the actual training. Subclasses must implement this method. The method should upon entry, call setTrainingSet(training_set); The method should:
Implements PLearn::SequentialLearner. Definition at line 81 of file MovingAverage.cc. References PLearn::columnMean(), computeCostsFromOutputs(), PLearn::endl(), PLearn::VMat::getSubRow(), PLearn::TVec< T >::hasMissing(), PLearn::PLearner::inputsize(), PLearn::VMat::length(), PLearn::Mat, MAX, PLearn::SequentialLearner::outputsize(), PLearn::VMat::subMat(), PLearn::PLearner::targetsize(), PLearn::ProgressBar::update(), PLearn::Vec, and window_length. |
|
Definition at line 54 of file MovingAverage.h. Referenced by build_(), computeCostsFromOutputs(), and getTrainCostNames(). |
|
Definition at line 53 of file MovingAverage.h. |