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

PLearn::SelectInputSubsetLearner Class Reference

#include <SelectInputSubsetLearner.h>

Inheritance diagram for PLearn::SelectInputSubsetLearner:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SelectInputSubsetLearner ()
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 (SelectInputSubsetLearner)
virtual int inputsize () const
 Default returns train_set->inputsize().

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
 Default calls computeOutput and computeCostsFromOutputs You may overload this if you have a more efficient way to compute both output and weighted costs at the same time.

virtual void setTrainingSet (VMat training_set, bool call_forget=true)
 Declares the train_set Then calls build() and forget() if necessary Note: You shouldn't have to overload this in subclasses, except in maybe to forward the call to an underlying learner.


Public Attributes

TVec< intselected_inputs
real random_fraction

Static Protected Member Functions

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


Protected Attributes

Vec learner_inputs
TVec< intall_indices

Private Types

typedef EmbeddedLearner inherited

Private Member Functions

void build_ ()
 This does the actual building.


Member Typedef Documentation

typedef EmbeddedLearner PLearn::SelectInputSubsetLearner::inherited [private]
 

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 57 of file SelectInputSubsetLearner.h.


Constructor & Destructor Documentation

PLearn::SelectInputSubsetLearner::SelectInputSubsetLearner  ) 
 

Definition at line 50 of file SelectInputSubsetLearner.cc.


Member Function Documentation

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

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

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 95 of file SelectInputSubsetLearner.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 80 of file SelectInputSubsetLearner.cc.

References learner_inputs, PLearn::TVec< int >::length(), random_fraction, PLearn::TVec< T >::resize(), PLearn::TVec< int >::resize(), selected_inputs, and PLearn::shuffleElements().

Referenced by build().

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

Computes the costs from already computed output.

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 126 of file SelectInputSubsetLearner.cc.

References learner_inputs, PLearn::TVec< T >::length(), and selected_inputs.

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

Computes the output from the input.

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 119 of file SelectInputSubsetLearner.cc.

References learner_inputs, PLearn::TVec< T >::length(), and selected_inputs.

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

Default calls computeOutput and computeCostsFromOutputs You may overload this if you have a more efficient way to compute both output and weighted costs at the same time.

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 135 of file SelectInputSubsetLearner.cc.

References learner_inputs, PLearn::TVec< T >::length(), and selected_inputs.

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

Declares this class' options.

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 60 of file SelectInputSubsetLearner.cc.

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

int PLearn::SelectInputSubsetLearner::inputsize  )  const [virtual]
 

Default returns train_set->inputsize().

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 115 of file SelectInputSubsetLearner.cc.

Referenced by setTrainingSet().

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::EmbeddedLearner.

Definition at line 102 of file SelectInputSubsetLearner.cc.

References all_indices, PLearn::deepCopyField(), learner_inputs, and selected_inputs.

PLearn::SelectInputSubsetLearner::PLEARN_DECLARE_OBJECT SelectInputSubsetLearner   ) 
 

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

Declares the train_set Then calls build() and forget() if necessary Note: You shouldn't have to overload this in subclasses, except in maybe to forward the call to an underlying learner.

Reimplemented from PLearn::PLearner.

Definition at line 143 of file SelectInputSubsetLearner.cc.

References all_indices, inputsize(), PLearn::TVec< int >::length(), PLearn::TVec< int >::resize(), selected_inputs, and PLearn::VMat::width().


Member Data Documentation

TVec<int> PLearn::SelectInputSubsetLearner::all_indices [protected]
 

Definition at line 65 of file SelectInputSubsetLearner.h.

Referenced by makeDeepCopyFromShallowCopy(), and setTrainingSet().

Vec PLearn::SelectInputSubsetLearner::learner_inputs [protected]
 

Definition at line 64 of file SelectInputSubsetLearner.h.

Referenced by build_(), computeCostsFromOutputs(), computeOutput(), computeOutputAndCosts(), and makeDeepCopyFromShallowCopy().

real PLearn::SelectInputSubsetLearner::random_fraction
 

Definition at line 82 of file SelectInputSubsetLearner.h.

Referenced by build_().

TVec<int> PLearn::SelectInputSubsetLearner::selected_inputs
 

Definition at line 78 of file SelectInputSubsetLearner.h.

Referenced by build_(), computeCostsFromOutputs(), computeOutput(), computeOutputAndCosts(), makeDeepCopyFromShallowCopy(), and setTrainingSet().


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