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

PLearn::TemporalHorizonVMatrix Class Reference

This VMat delay the last targetsize entries of an underlying VMat by a certain horizon. More...

#include <TemporalHorizonVMatrix.h>

Inheritance diagram for PLearn::TemporalHorizonVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TemporalHorizonVMatrix ()
 Also copies the original fieldinfos upon construction.

 TemporalHorizonVMatrix (VMat the_distr, int the_horizon, int target_size)
 PLEARN_DECLARE_OBJECT (TemporalHorizonVMatrix)
virtual void build ()
 Should call simply inherited::build(), then this class's build_().

virtual void makeDeepCopyFromShallowCopy (map< const void *, void * > &copies)
virtual real get (int i, int j) const
 returns element (i,j)

virtual void put (int i, int j, real value)
 sets element (i,j) to value

virtual real getStringVal (int col, const string &str) const
 returns value associated with a string (or MISSING_VALUE if there's no association for this string)

virtual string getValString (int col, real val) const
 returns the string associated with value val for field# col.

virtual string getString (int row, int col) const
 returns element as a string, even if value doesn't map to a string, in which case tostring(value) is returned

virtual const map< string,
real > & 
getStringToRealMapping (int col) const
 returns the whole string->value mapping

virtual const map< real, string > & getRealToStringMapping (int col) const
 returns the value->string mapping for field 'fld'

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

virtual real dot (int i1, int i2, int inputsize) const
virtual real dot (int i, const Vec &v) const
 returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered).


Static Public 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
int horizon
int targetsize
TVec< introw_delay

Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

This VMat delay the last targetsize entries of an underlying VMat by a certain horizon.

Definition at line 54 of file TemporalHorizonVMatrix.h.


Member Typedef Documentation

typedef VMatrix PLearn::TemporalHorizonVMatrix::inherited [private]
 

Reimplemented from PLearn::VMatrix.

Definition at line 56 of file TemporalHorizonVMatrix.h.

Referenced by TemporalHorizonVMatrix().


Constructor & Destructor Documentation

PLearn::TemporalHorizonVMatrix::TemporalHorizonVMatrix  )  [inline]
 

Also copies the original fieldinfos upon construction.

Definition at line 67 of file TemporalHorizonVMatrix.h.

PLearn::TemporalHorizonVMatrix::TemporalHorizonVMatrix VMat  the_distr,
int  the_horizon,
int  target_size
 

Definition at line 52 of file TemporalHorizonVMatrix.cc.

References distr, horizon, inherited, PLearn::TVec< int >::resize(), row_delay, targetsize, and PLearn::VMatrix::width().


Member Function Documentation

void PLearn::TemporalHorizonVMatrix::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 121 of file TemporalHorizonVMatrix.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 130 of file TemporalHorizonVMatrix.cc.

References distr, horizon, PLearn::VMat::length(), PLearn::TVec< int >::resize(), row_delay, targetsize, PLearn::VMatrix::width(), and PLearn::VMat::width().

Referenced by build().

void PLearn::TemporalHorizonVMatrix::declareOptions OptionList ol  )  [static]
 

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 101 of file TemporalHorizonVMatrix.cc.

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

real PLearn::TemporalHorizonVMatrix::dot int  i,
const Vec v
const [virtual]
 

returns the result of the dot product between row i and the given vec (only v.length() first elements of row i are considered).

Reimplemented from PLearn::VMatrix.

Definition at line 78 of file TemporalHorizonVMatrix.cc.

References distr, k, PLearn::TVec< T >::length(), row_delay, and PLearn::Vec.

real PLearn::TemporalHorizonVMatrix::dot int  i1,
int  i2,
int  inputsize
const [virtual]
 

returns the dot product between row i1 and row i2 (considering only the inputsize first elements). The default version in VMatrix is somewhat inefficient, as it repeatedly calls get(i,j) The default version in RowBufferedVMatrix is a little better as it buffers the 2 Vecs between calls in case one of them is needed again. But the real strength of this method is for specialised and efficient versions in subbclasses. This method is typically used by SmartKernels so that they can compute kernel values between input samples efficiently.

Reimplemented from PLearn::VMatrix.

Definition at line 70 of file TemporalHorizonVMatrix.cc.

References distr, k, and row_delay.

real PLearn::TemporalHorizonVMatrix::get int  i,
int  j
const [virtual]
 

returns element (i,j)

Reimplemented from PLearn::VMatrix.

Definition at line 64 of file TemporalHorizonVMatrix.cc.

References distr, and row_delay.

const map< real, string > & PLearn::TemporalHorizonVMatrix::getRealToStringMapping int  col  )  const [virtual]
 

returns the value->string mapping for field 'fld'

Reimplemented from PLearn::VMatrix.

Definition at line 98 of file TemporalHorizonVMatrix.cc.

References distr.

string PLearn::TemporalHorizonVMatrix::getString int  row,
int  col
const [virtual]
 

returns element as a string, even if value doesn't map to a string, in which case tostring(value) is returned

Reimplemented from PLearn::VMatrix.

Definition at line 92 of file TemporalHorizonVMatrix.cc.

References distr, and row_delay.

const map< string, real > & PLearn::TemporalHorizonVMatrix::getStringToRealMapping int  col  )  const [virtual]
 

returns the whole string->value mapping

Reimplemented from PLearn::VMatrix.

Definition at line 95 of file TemporalHorizonVMatrix.cc.

References distr.

real PLearn::TemporalHorizonVMatrix::getStringVal int  col,
const string str
const [virtual]
 

returns value associated with a string (or MISSING_VALUE if there's no association for this string)

Reimplemented from PLearn::VMatrix.

Definition at line 86 of file TemporalHorizonVMatrix.cc.

References distr.

string PLearn::TemporalHorizonVMatrix::getValString int  col,
real  val
const [virtual]
 

returns the string associated with value val for field# col.

Or returns "" if no string is associated.

Reimplemented from PLearn::VMatrix.

Definition at line 89 of file TemporalHorizonVMatrix.cc.

References distr, and val.

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

Reimplemented from PLearn::VMatrix.

Definition at line 112 of file TemporalHorizonVMatrix.cc.

References PLearn::deepCopyField(), and distr.

PLearn::TemporalHorizonVMatrix::PLEARN_DECLARE_OBJECT TemporalHorizonVMatrix   ) 
 

void PLearn::TemporalHorizonVMatrix::put int  i,
int  j,
real  value
[virtual]
 

sets element (i,j) to value

Reimplemented from PLearn::VMatrix.

Definition at line 67 of file TemporalHorizonVMatrix.cc.

References distr, and row_delay.

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 87 of file TemporalHorizonVMatrix.h.

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


Member Data Documentation

VMat PLearn::TemporalHorizonVMatrix::distr [protected]
 

Definition at line 59 of file TemporalHorizonVMatrix.h.

Referenced by build_(), dot(), get(), getRealToStringMapping(), getString(), getStringToRealMapping(), getStringVal(), getValString(), makeDeepCopyFromShallowCopy(), put(), reset_dimensions(), and TemporalHorizonVMatrix().

int PLearn::TemporalHorizonVMatrix::horizon [protected]
 

Definition at line 60 of file TemporalHorizonVMatrix.h.

Referenced by build_(), and TemporalHorizonVMatrix().

TVec<int> PLearn::TemporalHorizonVMatrix::row_delay [protected]
 

Definition at line 62 of file TemporalHorizonVMatrix.h.

Referenced by build_(), dot(), get(), getString(), put(), and TemporalHorizonVMatrix().

int PLearn::TemporalHorizonVMatrix::targetsize [protected]
 

Definition at line 61 of file TemporalHorizonVMatrix.h.

Referenced by build_(), and TemporalHorizonVMatrix().


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