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

PLearn::GeneralizedOneHotVMatrix Class Reference

This VMat is a generalization of OneHotVMatrix where all columns (given by the Vec index) are mapped, instead of just the last one. More...

#include <GeneralizedOneHotVMatrix.h>

Inheritance diagram for PLearn::GeneralizedOneHotVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GeneralizedOneHotVMatrix ()
 default constructor (for automatic deserialization)

 GeneralizedOneHotVMatrix (VMat the_distr, Vec the_index, Vec the_nclasses, Vec the_cold_value, Vec the_host_value)
 Warning: VMFields are NOT YET handled by this constructor.

 PLEARN_DECLARE_OBJECT (GeneralizedOneHotVMatrix)
virtual void build ()
 Should call simply inherited::build(), then this class's build_().

virtual void reset_dimensions ()
 in case the dimensions of an underlying vmat has changed, recompute it


Protected Member Functions

virtual void getNewRow (int i, const Vec &samplevec) const
 This is the only method requiring implementation in subclasses.


Static Protected Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Protected Attributes

VMat distr
Vec index
Vec nclasses
Vec cold_value
Vec hot_value

Private Types

typedef RowBufferedVMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

This VMat is a generalization of OneHotVMatrix where all columns (given by the Vec index) are mapped, instead of just the last one.

Definition at line 56 of file GeneralizedOneHotVMatrix.h.


Member Typedef Documentation

typedef RowBufferedVMatrix PLearn::GeneralizedOneHotVMatrix::inherited [private]
 

Reimplemented from PLearn::RowBufferedVMatrix.

Definition at line 58 of file GeneralizedOneHotVMatrix.h.

Referenced by GeneralizedOneHotVMatrix().


Constructor & Destructor Documentation

PLearn::GeneralizedOneHotVMatrix::GeneralizedOneHotVMatrix  ) 
 

default constructor (for automatic deserialization)

Definition at line 51 of file GeneralizedOneHotVMatrix.cc.

PLearn::GeneralizedOneHotVMatrix::GeneralizedOneHotVMatrix VMat  the_distr,
Vec  the_index,
Vec  the_nclasses,
Vec  the_cold_value,
Vec  the_host_value
 

Warning: VMFields are NOT YET handled by this constructor.

Definition at line 55 of file GeneralizedOneHotVMatrix.cc.

References cold_value, distr, hot_value, index, inherited, PLearn::TVec< T >::length(), PLearn::VMat::length(), PLearn::max(), PLearn::min(), nclasses, PLERROR, PLearn::sum(), and PLearn::Vec.


Member Function Documentation

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

Should call simply inherited::build(), then this class's build_().

This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::VMatrix.

Definition at line 70 of file GeneralizedOneHotVMatrix.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 77 of file GeneralizedOneHotVMatrix.cc.

Referenced by build().

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

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::VMatrix.

Definition at line 82 of file GeneralizedOneHotVMatrix.cc.

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

void PLearn::GeneralizedOneHotVMatrix::getNewRow int  i,
const Vec samplevec
const [protected, virtual]
 

This is the only method requiring implementation in subclasses.

Implements PLearn::RowBufferedVMatrix.

Definition at line 92 of file GeneralizedOneHotVMatrix.cc.

References cold_value, distr, PLearn::fill_one_hot(), hot_value, index, PLearn::TVec< T >::length(), PLearn::VMatrix::length(), nclasses, PLERROR, PLearn::TVec< T >::subVec(), PLearn::vec_find(), PLearn::VMat::width(), and PLearn::VMatrix::width().

PLearn::GeneralizedOneHotVMatrix::PLEARN_DECLARE_OBJECT GeneralizedOneHotVMatrix   ) 
 

virtual void PLearn::GeneralizedOneHotVMatrix::reset_dimensions  )  [inline, virtual]
 

in case the dimensions of an underlying vmat has changed, recompute it

Reimplemented from PLearn::VMatrix.

Definition at line 89 of file GeneralizedOneHotVMatrix.h.

References distr, PLearn::VMat::length(), and PLearn::VMat::width().


Member Data Documentation

Vec PLearn::GeneralizedOneHotVMatrix::cold_value [protected]
 

Definition at line 64 of file GeneralizedOneHotVMatrix.h.

Referenced by GeneralizedOneHotVMatrix(), and getNewRow().

VMat PLearn::GeneralizedOneHotVMatrix::distr [protected]
 

Definition at line 61 of file GeneralizedOneHotVMatrix.h.

Referenced by GeneralizedOneHotVMatrix(), getNewRow(), and reset_dimensions().

Vec PLearn::GeneralizedOneHotVMatrix::hot_value [protected]
 

Definition at line 65 of file GeneralizedOneHotVMatrix.h.

Referenced by GeneralizedOneHotVMatrix(), and getNewRow().

Vec PLearn::GeneralizedOneHotVMatrix::index [protected]
 

Definition at line 62 of file GeneralizedOneHotVMatrix.h.

Referenced by GeneralizedOneHotVMatrix(), and getNewRow().

Vec PLearn::GeneralizedOneHotVMatrix::nclasses [protected]
 

Definition at line 63 of file GeneralizedOneHotVMatrix.h.

Referenced by GeneralizedOneHotVMatrix(), and getNewRow().


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