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

PLearn::GaussianDistribution Class Reference

#include <GaussianDistribution.h>

Inheritance diagram for PLearn::GaussianDistribution:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef PDistribution inherited

Public Member Functions

 GaussianDistribution ()
 PLEARN_DECLARE_OBJECT (GaussianDistribution)
void makeDeepCopyFromShallowCopy (CopiesMap &copies)
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 real log_density (const Vec &x) const
 Return log of probability density log(p(y | x)).

virtual void resetGenerator (long g_seed) const
 Resets the random number generator used by generate using the given seed.

virtual void generate (Vec &x) const
 return a pseudo-random sample generated from the distribution.

virtual int inputsize () const
 Overridden so that it does not necessarily need a training set.


Public Attributes

Vec mu
Vec eigenvalues
Mat eigenvectors
int k
real gamma
float ignore_weights_below
 When doing a weighted fitting (weightsize==1), points with a weight below this value will be ignored.


Static Protected Member Functions

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


Member Typedef Documentation

typedef PDistribution PLearn::GaussianDistribution::inherited
 

Reimplemented from PLearn::PDistribution.

Definition at line 63 of file GaussianDistribution.h.


Constructor & Destructor Documentation

PLearn::GaussianDistribution::GaussianDistribution  ) 
 

Definition at line 68 of file GaussianDistribution.cc.

References k.


Member Function Documentation

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

Declares this class' options.

Reimplemented from PLearn::PDistribution.

Definition at line 74 of file GaussianDistribution.cc.

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

void PLearn::GaussianDistribution::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!)

Reimplemented from PLearn::PDistribution.

Definition at line 94 of file GaussianDistribution.cc.

void PLearn::GaussianDistribution::generate Vec x  )  const [virtual]
 

return a pseudo-random sample generated from the distribution.

Reimplemented from PLearn::PDistribution.

Definition at line 142 of file GaussianDistribution.cc.

References eigenvalues, eigenvectors, PLearn::fill_random_normal(), gamma, PLearn::TVec< T >::length(), PLearn::TMat< T >::length(), mu, PLearn::TVec< T >::resize(), PLearn::sqrt(), PLearn::transposeProduct(), and x.

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

Overridden so that it does not necessarily need a training set.

Reimplemented from PLearn::PLearner.

Definition at line 162 of file GaussianDistribution.cc.

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

Referenced by train().

real PLearn::GaussianDistribution::log_density const Vec x  )  const [virtual]
 

Return log of probability density log(p(y | x)).

Reimplemented from PLearn::PDistribution.

Definition at line 131 of file GaussianDistribution.cc.

References eigenvalues, eigenvectors, gamma, PLearn::logOfCompactGaussian(), mu, and x.

void PLearn::GaussianDistribution::makeDeepCopyFromShallowCopy CopiesMap copies  )  [virtual]
 

Does the necessary operations to transform a shallow copy (this) into a deep copy by deep-copying all the members that need to be. Typical implementation:

void CLASS_OF_THIS::makeDeepCopyFromShallowCopy(CopiesMap& copies) { SUPERCLASS_OF_THIS::makeDeepCopyFromShallowCopy(copies); member_ptr = member_ptr->deepCopy(copies); member_smartptr = member_smartptr->deepCopy(copies); member_mat.makeDeepCopyFromShallowCopy(copies); member_vec.makeDeepCopyFromShallowCopy(copies); ... }

Reimplemented from PLearn::PLearner.

Definition at line 59 of file GaussianDistribution.cc.

References PLearn::CopiesMap, PLearn::deepCopyField(), eigenvalues, eigenvectors, and mu.

PLearn::GaussianDistribution::PLEARN_DECLARE_OBJECT GaussianDistribution   ) 
 

void PLearn::GaussianDistribution::resetGenerator long  g_seed  )  const [virtual]
 

Resets the random number generator used by generate using the given seed.

Reimplemented from PLearn::PDistribution.

Definition at line 137 of file GaussianDistribution.cc.

References PLearn::manual_seed().

void PLearn::GaussianDistribution::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.

Reimplemented from PLearn::PDistribution.

Definition at line 97 of file GaussianDistribution.cc.

References PLearn::computeMeanAndCovar(), PLearn::computeWeightedMeanAndCovar(), eigenvalues, PLearn::eigenVecOfSymmMat(), eigenvectors, PLearn::PLearner::getTrainingSet(), ignore_weights_below, inputsize(), k, PLearn::VMat::length(), PLearn::min(), mu, PLERROR, PLearn::VMat::width(), and PLearn::ws().


Member Data Documentation

Vec PLearn::GaussianDistribution::eigenvalues
 

Definition at line 67 of file GaussianDistribution.h.

Referenced by generate(), log_density(), makeDeepCopyFromShallowCopy(), and train().

Mat PLearn::GaussianDistribution::eigenvectors
 

Definition at line 68 of file GaussianDistribution.h.

Referenced by generate(), log_density(), makeDeepCopyFromShallowCopy(), and train().

real PLearn::GaussianDistribution::gamma
 

Definition at line 72 of file GaussianDistribution.h.

Referenced by generate(), and log_density().

float PLearn::GaussianDistribution::ignore_weights_below
 

When doing a weighted fitting (weightsize==1), points with a weight below this value will be ignored.

Definition at line 73 of file GaussianDistribution.h.

Referenced by train().

int PLearn::GaussianDistribution::k
 

Definition at line 71 of file GaussianDistribution.h.

Referenced by train().

Vec PLearn::GaussianDistribution::mu
 

Definition at line 66 of file GaussianDistribution.h.

Referenced by generate(), inputsize(), log_density(), makeDeepCopyFromShallowCopy(), and train().


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