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

PLearn::ConstantRegressor Class Reference

#include <ConstantRegressor.h>

Inheritance diagram for PLearn::ConstantRegressor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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


Public Attributes

real weight_decay
 Weight decay; not usually useful but...


Static Protected Member Functions

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


Protected Attributes

Vec constant_output

Private Types

typedef PLearner inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

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

Reimplemented from PLearn::PLearner.

Definition at line 52 of file ConstantRegressor.h.


Constructor & Destructor Documentation

PLearn::ConstantRegressor::ConstantRegressor  ) 
 

Definition at line 46 of file ConstantRegressor.cc.


Member Function Documentation

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

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

Reimplemented from PLearn::PLearner.

Definition at line 93 of file ConstantRegressor.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::PLearner.

Definition at line 88 of file ConstantRegressor.cc.

Referenced by build().

void PLearn::ConstantRegressor::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 160 of file ConstantRegressor.cc.

References PLearn::powdistance().

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

Computes the output from the input.

Implements PLearn::PLearner.

Definition at line 153 of file ConstantRegressor.cc.

References constant_output, outputsize(), and PLearn::TVec< T >::resize().

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

Declares this class' options.

Reimplemented from PLearn::PLearner.

Definition at line 65 of file ConstantRegressor.cc.

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

void PLearn::ConstantRegressor::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 111 of file ConstantRegressor.cc.

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

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

Implements PLearn::PLearner.

Definition at line 167 of file ConstantRegressor.cc.

References getTrainCostNames().

TVec< string > PLearn::ConstantRegressor::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 173 of file ConstantRegressor.cc.

Referenced by getTestCostNames().

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

Transforms a shallow copy into a deep copy.

Definition at line 100 of file ConstantRegressor.cc.

int PLearn::ConstantRegressor::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 106 of file ConstantRegressor.cc.

References PLearn::PLearner::targetsize().

Referenced by computeOutput().

PLearn::ConstantRegressor::PLEARN_DECLARE_OBJECT ConstantRegressor   ) 
 

void PLearn::ConstantRegressor::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 116 of file ConstantRegressor.cc.

References PLearn::TVec< T >::clear(), constant_output, PLearn::VMat::getExample(), PLearn::PLearner::inputsize(), PLearn::VMat::length(), PLearn::multiply(), PLearn::multiplyAdd(), PLearn::powdistance(), PLearn::TVec< T >::resize(), PLearn::PLearner::targetsize(), and PLearn::Vec.


Member Data Documentation

Vec PLearn::ConstantRegressor::constant_output [protected]
 

Definition at line 60 of file ConstantRegressor.h.

Referenced by computeOutput(), and train().

real PLearn::ConstantRegressor::weight_decay
 

Weight decay; not usually useful but...

Definition at line 65 of file ConstantRegressor.h.


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