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

PLearn::ShiftAndRescaleVMatrix Class Reference

#include <ShiftAndRescaleVMatrix.h>

Inheritance diagram for PLearn::ShiftAndRescaleVMatrix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ShiftAndRescaleVMatrix ()
 For all constructors, the original VMFields are copied upon construction.

 ShiftAndRescaleVMatrix (VMat underlying_distr, Vec the_shift, Vec the_scale)
 ShiftAndRescaleVMatrix (VMat underlying_distr, int n_inputs)
 ShiftAndRescaleVMatrix (VMat underlying_distr, int n_inputs, int n_train, bool the_ignore_missing=false, bool the_verbosity=1)
 PLEARN_DECLARE_OBJECT (ShiftAndRescaleVMatrix)
virtual real get (int i, int j) const
 returns element (i,j)

virtual void getSubRow (int i, int j, Vec v) const
 fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)

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

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


Public Attributes

VMat vm
 x'_i = (x_i+shift_i)*scale_i

Vec shift
Vec scale
bool automatic
int n_train
int n_inputs
bool negate_shift
bool no_scale
bool ignore_missing
int verbosity

Static Protected Member Functions

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


Private Types

typedef VMatrix inherited

Private Member Functions

void build_ ()
 This does the actual building.


Detailed Description

VMatrix that can be used to rescale and shift each feature of the underlying distribution: x'_i = a_i*(x_i+b_i) This can be used to normalize the inputs of a distribution (see the NormalizeInputDistr function in PLearn.h)

Definition at line 57 of file ShiftAndRescaleVMatrix.h.


Member Typedef Documentation

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

Reimplemented from PLearn::VMatrix.

Definition at line 59 of file ShiftAndRescaleVMatrix.h.


Constructor & Destructor Documentation

PLearn::ShiftAndRescaleVMatrix::ShiftAndRescaleVMatrix  ) 
 

For all constructors, the original VMFields are copied upon construction.

Definition at line 65 of file ShiftAndRescaleVMatrix.cc.

PLearn::ShiftAndRescaleVMatrix::ShiftAndRescaleVMatrix VMat  underlying_distr,
Vec  the_shift,
Vec  the_scale
 

Definition at line 53 of file ShiftAndRescaleVMatrix.cc.

References build_(), PLearn::Vec, and vm.

PLearn::ShiftAndRescaleVMatrix::ShiftAndRescaleVMatrix VMat  underlying_distr,
int  n_inputs
 

Definition at line 73 of file ShiftAndRescaleVMatrix.cc.

References build_(), and vm.

PLearn::ShiftAndRescaleVMatrix::ShiftAndRescaleVMatrix VMat  underlying_distr,
int  n_inputs,
int  n_train,
bool  the_ignore_missing = false,
bool  the_verbosity = 1
 

Definition at line 86 of file ShiftAndRescaleVMatrix.cc.

References build_(), and vm.


Member Function Documentation

void PLearn::ShiftAndRescaleVMatrix::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 229 of file ShiftAndRescaleVMatrix.cc.

References build_().

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

This does the actual building.

Reimplemented from PLearn::VMatrix.

Definition at line 123 of file ShiftAndRescaleVMatrix.cc.

References automatic, PLearn::computeMeanAndStddev(), PLearn::computeStats(), ignore_missing, PLearn::invertElements(), PLearn::TVec< T >::length(), PLearn::VMat::length(), n_inputs, n_train, negate_shift, PLearn::negateElements(), no_scale, PLERROR, PLWARNING, reset_dimensions(), PLearn::TVec< T >::resize(), scale, shift, PLearn::VMat::subMat(), PLearn::VMat::subMatColumns(), PLearn::VMat::subMatRows(), PLearn::TVec< T >::subVec(), verbosity, vm, and PLearn::VMat::width().

Referenced by build(), and ShiftAndRescaleVMatrix().

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

Declares this class' options.

Reimplemented from PLearn::VMatrix.

Definition at line 97 of file ShiftAndRescaleVMatrix.cc.

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

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

returns element (i,j)

Reimplemented from PLearn::VMatrix.

Definition at line 192 of file ShiftAndRescaleVMatrix.cc.

References negate_shift, no_scale, scale, shift, and vm.

void PLearn::ShiftAndRescaleVMatrix::getSubRow int  i,
int  j,
Vec  v
const [virtual]
 

fills v with the subrow i lying between columns j (inclusive) and j+v.length() (exclusive)

Reimplemented from PLearn::VMatrix.

Definition at line 209 of file ShiftAndRescaleVMatrix.cc.

References PLearn::VMat::getSubRow(), PLearn::TVec< T >::length(), negate_shift, no_scale, scale, shift, and vm.

PLearn::ShiftAndRescaleVMatrix::PLEARN_DECLARE_OBJECT ShiftAndRescaleVMatrix   ) 
 

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

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

Reimplemented from PLearn::VMatrix.

Definition at line 84 of file ShiftAndRescaleVMatrix.h.

References PLERROR, vm, and PLearn::VMat::width().

Referenced by build_().


Member Data Documentation

bool PLearn::ShiftAndRescaleVMatrix::automatic
 

Definition at line 66 of file ShiftAndRescaleVMatrix.h.

Referenced by build_().

bool PLearn::ShiftAndRescaleVMatrix::ignore_missing
 

Definition at line 71 of file ShiftAndRescaleVMatrix.h.

Referenced by build_().

int PLearn::ShiftAndRescaleVMatrix::n_inputs
 

Definition at line 68 of file ShiftAndRescaleVMatrix.h.

Referenced by build_().

int PLearn::ShiftAndRescaleVMatrix::n_train
 

Definition at line 67 of file ShiftAndRescaleVMatrix.h.

Referenced by build_().

bool PLearn::ShiftAndRescaleVMatrix::negate_shift
 

Definition at line 69 of file ShiftAndRescaleVMatrix.h.

Referenced by build_(), get(), and getSubRow().

bool PLearn::ShiftAndRescaleVMatrix::no_scale
 

Definition at line 70 of file ShiftAndRescaleVMatrix.h.

Referenced by build_(), get(), and getSubRow().

Vec PLearn::ShiftAndRescaleVMatrix::scale
 

Definition at line 65 of file ShiftAndRescaleVMatrix.h.

Referenced by build_(), get(), and getSubRow().

Vec PLearn::ShiftAndRescaleVMatrix::shift
 

Definition at line 64 of file ShiftAndRescaleVMatrix.h.

Referenced by build_(), get(), and getSubRow().

int PLearn::ShiftAndRescaleVMatrix::verbosity
 

Definition at line 72 of file ShiftAndRescaleVMatrix.h.

Referenced by build_().

VMat PLearn::ShiftAndRescaleVMatrix::vm
 

x'_i = (x_i+shift_i)*scale_i

Definition at line 63 of file ShiftAndRescaleVMatrix.h.

Referenced by build_(), get(), getSubRow(), reset_dimensions(), and ShiftAndRescaleVMatrix().


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