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

PLearn::GaussMix Class Reference

#include <GaussMix.h>

Inheritance diagram for PLearn::GaussMix:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GaussMix ()
 Default constructor.

virtual void generate (Vec &s) const
 Overridden.

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

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 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 (GaussMix)
 Declares name and deepCopy methods.

virtual void train ()
 Trains the model.

virtual void setInput (const Vec &input) const
 Set the value for the input part of the conditional probability.

virtual void updateFromConditionalSorting ()
 This method updates the internal data given a new sorting of the variables defined by the conditional flags.

virtual real log_density (const Vec &y) const
 return density p(y | x)

virtual real survival_fn (const Vec &y) const
 return survival fn = P(Y>y | x)

virtual real cdf (const Vec &y) const
 return survival fn = P(Y<y | x)

virtual void expectation (Vec &mu) const
 Compute E[Y | x].

virtual void variance (Mat &cov) const
 Compute Var[Y | x].

int getNEigenComputed () const
 "Get" methods.

Mat getEigenvectors (int j) const
Vec getEigenvals (int j) const

Public Attributes

real alpha_min
real epsilon
int kmeans_iterations
int L
int n_eigen
real sigma_min
string type
Vec alpha
Mat mu
Vec sigma

Protected Member Functions

virtual void computeMeansAndCovariances ()
 Given the posteriors, fill the centers and covariance of each Gaussian.

virtual real computeLogLikelihood (const Vec &y, int j, bool is_input=false) const
 Compute log p(y | x,j), where j < L is the index of a component of the mixture.

virtual void computePosteriors ()
 Compute the posteriors P(j | s_i) for each sample point and each Gaussian.

virtual bool computeWeights ()
 Compute the weight of each mixture (the coefficient alpha).

virtual void generateFromGaussian (Vec &s, int given_gaussian) const
 Generate a sample s from the given Gaussian.

virtual void precomputeStuff ()
 Precompute stuff specific to each Gaussian, given its current paremeters.

virtual void replaceGaussian (int j)
 Replace the j-th Gaussian with another one (probably because that one is not appropriate).

void resizeStuffBeforeTraining ()
 Resize everything before training.

void updateSampleWeights ()
 Update the sample weights according to their initial weights and the current posterior probabilities.

void kmeans (VMat samples, int nclust, TVec< int > &clust_idx, Mat &clust, int maxit=9999)
 Perform K-means.


Static Protected Member Functions

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


Protected Attributes

Mat eigenvalues
TVec< Mateigenvectors
int D
Mat diags
Vec log_coeff
Vec log_p_j_x
Vec log_p_x_j_alphaj
Mat mu_y_x
int n_eigen_computed
int nsamples
Vec p_j_x
TVec< Matcov_x
 The covariance of x.

TVec< Matcov_y_x
 The covariance of y|x.

Mat eigenvalues_x
 The eigenvalues of the covariance of X.

Mat eigenvalues_y_x
 The eigenvalues of the covariance of Y|x.

TVec< Mateigenvectors_x
 The eigenvectors of the covariance of X.

TVec< Mateigenvectors_y_x
 The eigenvectors of the covariance of Y|x.

TVec< Matfull_cov
 The full covariance matrix.

TVec< Maty_x_mat
 The product K2 * K1^-1 to compute E[Y|x].

Mat posteriors
 The posterior probabilities P(j | s_i), where j is the index of a Gaussian and i is the index of a sample.

Vec initial_weights
 The initial weights of the samples s_i in the training set, copied for efficiency concerns.

Mat updated_weights
 A matrix whose j-th line is a Vec with the weights of each sample s_i, multiplied by the posterior P(j | s_i).


Private Types

typedef PDistribution inherited

Private Member Functions

void build_ ()
 This does the actual building.


Private Attributes

Vec sample_row
 Storage vectors to save memory allocations.

Vec log_likelihood_post
 Storage vectors to save memory allocations.

Vec x_minus_mu_x
Vec mu_target
Vec log_likelihood_dens

Member Typedef Documentation

typedef PDistribution PLearn::GaussMix::inherited [private]
 

Reimplemented from PLearn::PDistribution.

Reimplemented in PLearn::ManifoldParzen2.

Definition at line 53 of file GaussMix.h.


Constructor & Destructor Documentation

PLearn::GaussMix::GaussMix  ) 
 

Default constructor.

Definition at line 55 of file GaussMix.cc.


Member Function Documentation

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

simply calls inherited::build() then build_()

Reimplemented from PLearn::PDistribution.

Reimplemented in PLearn::ManifoldParzen2.

Definition at line 184 of file GaussMix.cc.

References build_().

Referenced by train().

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

This does the actual building.

Reimplemented from PLearn::PDistribution.

Reimplemented in PLearn::ManifoldParzen2.

Definition at line 193 of file GaussMix.cc.

References alpha, cov_x, cov_y_x, eigenvectors, eigenvectors_x, eigenvectors_y_x, full_cov, L, PLearn::log(), log_coeff, log_p_j_x, log_p_x_j_alphaj, p_j_x, PLERROR, PLearn::TVec< Mat >::resize(), PLearn::TVec< T >::resize(), sigma, type, and y_x_mat.

Referenced by build().

real PLearn::GaussMix::cdf const Vec y  )  const [virtual]
 

return survival fn = P(Y<y | x)

Reimplemented from PLearn::PDistribution.

Definition at line 1025 of file GaussMix.cc.

References PLERROR.

real PLearn::GaussMix::computeLogLikelihood const Vec y,
int  j,
bool  is_input = false
const [protected, virtual]
 

Compute log p(y | x,j), where j < L is the index of a component of the mixture.

If 'is_input' is set to true, then it will instead compute log p(x | j) (here x = y), the probability of the input part x given j.

Definition at line 284 of file GaussMix.cc.

References diags, PLearn::dot(), eigenvalues, eigenvalues_x, eigenvalues_y_x, eigenvectors, eigenvectors_x, eigenvectors_y_x, PLearn::gauss_log_density_stddev(), k, log_coeff, PLearn::max(), mu, mu_y_x, n_eigen_computed, PLERROR, PLWARNING, PLearn::pownorm(), PLearn::TVec< T >::resize(), sigma, sigma_min, PLearn::square(), and type.

Referenced by computePosteriors(), log_density(), and setInput().

void PLearn::GaussMix::computeMeansAndCovariances  )  [protected, virtual]
 

Given the posteriors, fill the centers and covariance of each Gaussian.

Definition at line 238 of file GaussMix.cc.

References PLearn::center(), PLearn::columnmatrix(), PLearn::columnSum(), PLearn::computeInputMeanAndCovar(), PLearn::computeInputMeanAndVariance(), D, diags, eigenvalues, PLearn::eigenVecOfSymmMat(), eigenvectors, epsilon, L, PLearn::mean(), mu, n_eigen_computed, nsamples, PLERROR, PLWARNING, posteriors, sigma, PLearn::sqrt(), type, updated_weights, and PLearn::variance().

Referenced by train().

void PLearn::GaussMix::computePosteriors  )  [protected, virtual]
 

Compute the posteriors P(j | s_i) for each sample point and each Gaussian.

Definition at line 390 of file GaussMix.cc.

References alpha, computeLogLikelihood(), D, PLearn::exp(), PLearn::VMat::getSubRow(), L, PLearn::log(), log_likelihood_post, PLearn::logadd(), nsamples, PLWARNING, posteriors, PLearn::TVec< T >::resize(), sample_row, and updateSampleWeights().

Referenced by train().

bool PLearn::GaussMix::computeWeights  )  [protected, virtual]
 

Compute the weight of each mixture (the coefficient alpha).

If a mixture has a too low coefficient, it will be removed, and the method will return 'true' (otherwise it will return 'false').

Definition at line 418 of file GaussMix.cc.

References alpha, alpha_min, PLearn::TVec< T >::fill(), L, nsamples, posteriors, and replaceGaussian().

Referenced by train().

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

Declares this class' options.

Reimplemented from PLearn::PDistribution.

Definition at line 92 of file GaussMix.cc.

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

void PLearn::GaussMix::expectation Vec mu  )  const [virtual]
 

Compute E[Y | x].

Reimplemented from PLearn::PDistribution.

Definition at line 441 of file GaussMix.cc.

References PLearn::TVec< T >::clear(), L, mu, mu_y_x, p_j_x, PLERROR, PLearn::TVec< T >::resize(), and type.

void PLearn::GaussMix::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 473 of file GaussMix.cc.

void PLearn::GaussMix::generate Vec s  )  const [virtual]
 

Overridden.

Reimplemented from PLearn::PDistribution.

Definition at line 481 of file GaussMix.cc.

References generateFromGaussian(), and x.

void PLearn::GaussMix::generateFromGaussian Vec s,
int  given_gaussian
const [protected, virtual]
 

Generate a sample s from the given Gaussian.

If 'given_gaussian' is equal to -1, then a random Gaussian will be chosen according to the weights alpha.

Definition at line 489 of file GaussMix.cc.

References alpha, diags, eigenvalues, eigenvalues_y_x, eigenvectors, eigenvectors_y_x, PLearn::TVec< T >::fill(), PLearn::fill_random_normal(), PLearn::gaussian_mu_sigma(), k, PLearn::TVec< T >::length(), PLearn::max(), mu, mu_y_x, PLearn::multinomial_sample(), n_eigen_computed, PLearn::norm(), p_j_x, PLERROR, PLearn::TVec< T >::resize(), sigma, sigma_min, PLearn::sqrt(), and type.

Referenced by generate(), and replaceGaussian().

Vec PLearn::GaussMix::getEigenvals int  j  )  const
 

Definition at line 562 of file GaussMix.cc.

References eigenvalues.

Mat PLearn::GaussMix::getEigenvectors int  j  )  const
 

Definition at line 555 of file GaussMix.cc.

References eigenvectors.

int PLearn::GaussMix::getNEigenComputed  )  const
 

"Get" methods.

Definition at line 548 of file GaussMix.cc.

References n_eigen_computed.

void PLearn::GaussMix::kmeans VMat  samples,
int  nclust,
TVec< int > &  clust_idx,
Mat clust,
int  maxit = 9999
[protected]
 

Perform K-means.

Definition at line 569 of file GaussMix.cc.

References PLearn::TVec< T >::clear(), PLearn::TMat< T >::clear(), PLearn::dist(), PLearn::VMat::getExample(), PLearn::VMat::length(), nsamples, PLearn::pownorm(), PLearn::TVec< T >::resize(), PLearn::TMat< T >::resize(), and val.

Referenced by train().

real PLearn::GaussMix::log_density const Vec y  )  const [virtual]
 

return density p(y | x)

Reimplemented from PLearn::PDistribution.

Definition at line 645 of file GaussMix.cc.

References computeLogLikelihood(), L, log_likelihood_dens, log_p_j_x, PLearn::logadd(), PLERROR, PLWARNING, and PLearn::TVec< T >::resize().

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

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::PDistribution.

Reimplemented in PLearn::ManifoldParzen2.

Definition at line 668 of file GaussMix.cc.

References alpha, PLearn::deepCopyField(), diags, eigenvalues, eigenvectors, initial_weights, log_coeff, log_likelihood_dens, log_likelihood_post, mu, mu_target, PLERROR, posteriors, sample_row, sigma, updated_weights, and x_minus_mu_x.

PLearn::GaussMix::PLEARN_DECLARE_OBJECT GaussMix   ) 
 

Declares name and deepCopy methods.

void PLearn::GaussMix::precomputeStuff  )  [protected, virtual]
 

Precompute stuff specific to each Gaussian, given its current paremeters.

Definition at line 692 of file GaussMix.cc.

References D, eigenvalues, epsilon, k, L, PLearn::log(), log_coeff, PLearn::max(), n_eigen_computed, PLERROR, PLWARNING, sigma_min, and type.

Referenced by train().

void PLearn::GaussMix::replaceGaussian int  j  )  [protected, virtual]
 

Replace the j-th Gaussian with another one (probably because that one is not appropriate).

The new one is centered on a random point sampled from the Gaussian with highest weight alpha, and has the same covariance.

Definition at line 723 of file GaussMix.cc.

References alpha, PLearn::TMat< T >::column(), diags, eigenvalues, eigenvectors, generateFromGaussian(), k, L, log_coeff, mu, PLERROR, sigma, and type.

Referenced by computeWeights().

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

Reset the random number generator used by generate() using the given seed.

Reimplemented from PLearn::PDistribution.

Definition at line 754 of file GaussMix.cc.

References PLearn::manual_seed().

void PLearn::GaussMix::resizeStuffBeforeTraining  )  [protected]
 

Resize everything before training.

Definition at line 762 of file GaussMix.cc.

References D, diags, eigenvalues, eigenvalues_x, eigenvalues_y_x, eigenvectors, initial_weights, L, PLearn::VMat::length(), mu, n_eigen, n_eigen_computed, nsamples, PLERROR, posteriors, PLearn::TVec< Mat >::resize(), PLearn::TMat< T >::resize(), PLearn::TVec< T >::resize(), type, and updated_weights.

Referenced by PLearn::ManifoldParzen2::train(), and train().

void PLearn::GaussMix::setInput const Vec input  )  const [virtual]
 

Set the value for the input part of the conditional probability.

Reimplemented from PLearn::PDistribution.

Definition at line 797 of file GaussMix.cc.

References alpha, computeLogLikelihood(), PLearn::exp(), L, PLearn::log(), log_p_j_x, log_p_x_j_alphaj, PLearn::logadd(), mu, mu_target, mu_y_x, p_j_x, PLERROR, PLearn::product(), PLearn::TVec< T >::resize(), PLearn::TVec< T >::subVec(), type, x_minus_mu_x, and y_x_mat.

real PLearn::GaussMix::survival_fn const Vec y  )  const [virtual]
 

return survival fn = P(Y>y | x)

Reimplemented from PLearn::PDistribution.

Definition at line 1017 of file GaussMix.cc.

References PLERROR.

void PLearn::GaussMix::train  )  [virtual]
 

Trains the model.

Reimplemented from PLearn::PDistribution.

Reimplemented in PLearn::ManifoldParzen2.

Definition at line 837 of file GaussMix.cc.

References build(), PLearn::TVec< T >::clear(), computeMeansAndCovariances(), computePosteriors(), computeWeights(), D, PLearn::TMat< T >::fill(), PLearn::TVec< T >::fill(), PLearn::VMat::getExample(), initial_weights, kmeans(), kmeans_iterations, L, log_p_j_x, mu, nsamples, PLERROR, PLWARNING, posteriors, precomputeStuff(), resizeStuffBeforeTraining(), PLearn::sample(), PLearn::ProgressBar::update(), and updateSampleWeights().

void PLearn::GaussMix::updateFromConditionalSorting  )  [virtual]
 

This method updates the internal data given a new sorting of the variables defined by the conditional flags.

Reimplemented from PLearn::PDistribution.

Definition at line 920 of file GaussMix.cc.

References PLearn::TMat< T >::clear(), PLearn::columnmatrix(), cov_x, cov_y_x, D, diags, eigenvalues, eigenvalues_x, eigenvalues_y_x, PLearn::eigenVecOfSymmMat(), eigenvectors, eigenvectors_x, eigenvectors_y_x, full_cov, k, L, PLearn::max(), mu, mu_y_x, n_eigen_computed, PLERROR, PLearn::product(), PLearn::productTranspose(), PLearn::TVec< Mat >::resize(), PLearn::TMat< T >::resize(), PLearn::rowmatrix(), sigma_min, PLearn::square(), PLearn::TMat< T >::subMat(), type, and y_x_mat.

void PLearn::GaussMix::updateSampleWeights  )  [protected]
 

Update the sample weights according to their initial weights and the current posterior probabilities.

Definition at line 1007 of file GaussMix.cc.

References PLearn::TMat< T >::column(), PLearn::columnmatrix(), initial_weights, L, posteriors, and updated_weights.

Referenced by computePosteriors(), and train().

void PLearn::GaussMix::variance Mat cov  )  const [virtual]
 

Compute Var[Y | x].

Reimplemented from PLearn::PDistribution.

Definition at line 1033 of file GaussMix.cc.

References PLERROR.


Member Data Documentation

Vec PLearn::GaussMix::alpha
 

Definition at line 115 of file GaussMix.h.

Referenced by build_(), computePosteriors(), computeWeights(), generateFromGaussian(), makeDeepCopyFromShallowCopy(), replaceGaussian(), and setInput().

real PLearn::GaussMix::alpha_min
 

Definition at line 106 of file GaussMix.h.

Referenced by computeWeights().

TVec<Mat> PLearn::GaussMix::cov_x [protected]
 

The covariance of x.

Definition at line 79 of file GaussMix.h.

Referenced by build_(), and updateFromConditionalSorting().

TVec<Mat> PLearn::GaussMix::cov_y_x [protected]
 

The covariance of y|x.

Definition at line 80 of file GaussMix.h.

Referenced by build_(), and updateFromConditionalSorting().

int PLearn::GaussMix::D [protected]
 

Definition at line 67 of file GaussMix.h.

Referenced by computeMeansAndCovariances(), computePosteriors(), precomputeStuff(), resizeStuffBeforeTraining(), train(), and updateFromConditionalSorting().

Mat PLearn::GaussMix::diags [protected]
 

Definition at line 68 of file GaussMix.h.

Referenced by computeLogLikelihood(), computeMeansAndCovariances(), generateFromGaussian(), makeDeepCopyFromShallowCopy(), replaceGaussian(), resizeStuffBeforeTraining(), and updateFromConditionalSorting().

Mat PLearn::GaussMix::eigenvalues [protected]
 

Definition at line 65 of file GaussMix.h.

Referenced by computeLogLikelihood(), computeMeansAndCovariances(), generateFromGaussian(), getEigenvals(), makeDeepCopyFromShallowCopy(), precomputeStuff(), replaceGaussian(), resizeStuffBeforeTraining(), and updateFromConditionalSorting().

Mat PLearn::GaussMix::eigenvalues_x [protected]
 

The eigenvalues of the covariance of X.

Definition at line 81 of file GaussMix.h.

Referenced by computeLogLikelihood(), resizeStuffBeforeTraining(), and updateFromConditionalSorting().

Mat PLearn::GaussMix::eigenvalues_y_x [protected]
 

The eigenvalues of the covariance of Y|x.

Definition at line 82 of file GaussMix.h.

Referenced by computeLogLikelihood(), generateFromGaussian(), resizeStuffBeforeTraining(), and updateFromConditionalSorting().

TVec<Mat> PLearn::GaussMix::eigenvectors [protected]
 

Definition at line 66 of file GaussMix.h.

Referenced by build_(), computeLogLikelihood(), computeMeansAndCovariances(), generateFromGaussian(), getEigenvectors(), makeDeepCopyFromShallowCopy(), replaceGaussian(), resizeStuffBeforeTraining(), and updateFromConditionalSorting().

TVec<Mat> PLearn::GaussMix::eigenvectors_x [protected]
 

The eigenvectors of the covariance of X.

Definition at line 83 of file GaussMix.h.

Referenced by build_(), computeLogLikelihood(), and updateFromConditionalSorting().

TVec<Mat> PLearn::GaussMix::eigenvectors_y_x [protected]
 

The eigenvectors of the covariance of Y|x.

Definition at line 84 of file GaussMix.h.

Referenced by build_(), computeLogLikelihood(), generateFromGaussian(), and updateFromConditionalSorting().

real PLearn::GaussMix::epsilon
 

Definition at line 107 of file GaussMix.h.

Referenced by computeMeansAndCovariances(), and precomputeStuff().

TVec<Mat> PLearn::GaussMix::full_cov [protected]
 

The full covariance matrix.

Definition at line 85 of file GaussMix.h.

Referenced by build_(), and updateFromConditionalSorting().

Vec PLearn::GaussMix::initial_weights [protected]
 

The initial weights of the samples s_i in the training set, copied for efficiency concerns.

Definition at line 94 of file GaussMix.h.

Referenced by makeDeepCopyFromShallowCopy(), resizeStuffBeforeTraining(), train(), and updateSampleWeights().

int PLearn::GaussMix::kmeans_iterations
 

Definition at line 108 of file GaussMix.h.

Referenced by train().

int PLearn::GaussMix::L
 

Definition at line 109 of file GaussMix.h.

Referenced by build_(), computeMeansAndCovariances(), computePosteriors(), computeWeights(), expectation(), log_density(), precomputeStuff(), replaceGaussian(), resizeStuffBeforeTraining(), setInput(), train(), updateFromConditionalSorting(), and updateSampleWeights().

Vec PLearn::GaussMix::log_coeff [protected]
 

Definition at line 69 of file GaussMix.h.

Referenced by build_(), computeLogLikelihood(), makeDeepCopyFromShallowCopy(), precomputeStuff(), and replaceGaussian().

Vec PLearn::GaussMix::log_likelihood_dens [mutable, private]
 

Definition at line 57 of file GaussMix.h.

Referenced by log_density(), and makeDeepCopyFromShallowCopy().

Vec PLearn::GaussMix::log_likelihood_post [private]
 

Storage vectors to save memory allocations.

Definition at line 56 of file GaussMix.h.

Referenced by computePosteriors(), and makeDeepCopyFromShallowCopy().

Vec PLearn::GaussMix::log_p_j_x [protected]
 

Definition at line 70 of file GaussMix.h.

Referenced by build_(), log_density(), setInput(), and train().

Vec PLearn::GaussMix::log_p_x_j_alphaj [protected]
 

Definition at line 71 of file GaussMix.h.

Referenced by build_(), and setInput().

Mat PLearn::GaussMix::mu
 

Definition at line 116 of file GaussMix.h.

Referenced by computeLogLikelihood(), computeMeansAndCovariances(), expectation(), generateFromGaussian(), makeDeepCopyFromShallowCopy(), replaceGaussian(), resizeStuffBeforeTraining(), setInput(), train(), and updateFromConditionalSorting().

Vec PLearn::GaussMix::mu_target [mutable, private]
 

Definition at line 57 of file GaussMix.h.

Referenced by makeDeepCopyFromShallowCopy(), and setInput().

Mat PLearn::GaussMix::mu_y_x [protected]
 

Definition at line 72 of file GaussMix.h.

Referenced by computeLogLikelihood(), expectation(), generateFromGaussian(), setInput(), and updateFromConditionalSorting().

int PLearn::GaussMix::n_eigen
 

Definition at line 110 of file GaussMix.h.

Referenced by resizeStuffBeforeTraining().

int PLearn::GaussMix::n_eigen_computed [protected]
 

Definition at line 73 of file GaussMix.h.

Referenced by computeLogLikelihood(), computeMeansAndCovariances(), generateFromGaussian(), getNEigenComputed(), precomputeStuff(), resizeStuffBeforeTraining(), and updateFromConditionalSorting().

int PLearn::GaussMix::nsamples [protected]
 

Definition at line 74 of file GaussMix.h.

Referenced by computeMeansAndCovariances(), computePosteriors(), computeWeights(), kmeans(), resizeStuffBeforeTraining(), and train().

Vec PLearn::GaussMix::p_j_x [protected]
 

Definition at line 75 of file GaussMix.h.

Referenced by build_(), expectation(), generateFromGaussian(), and setInput().

Mat PLearn::GaussMix::posteriors [protected]
 

The posterior probabilities P(j | s_i), where j is the index of a Gaussian and i is the index of a sample.

Definition at line 90 of file GaussMix.h.

Referenced by computeMeansAndCovariances(), computePosteriors(), computeWeights(), makeDeepCopyFromShallowCopy(), resizeStuffBeforeTraining(), train(), and updateSampleWeights().

Vec PLearn::GaussMix::sample_row [private]
 

Storage vectors to save memory allocations.

Definition at line 56 of file GaussMix.h.

Referenced by computePosteriors(), and makeDeepCopyFromShallowCopy().

Vec PLearn::GaussMix::sigma
 

Definition at line 117 of file GaussMix.h.

Referenced by build_(), computeLogLikelihood(), computeMeansAndCovariances(), generateFromGaussian(), makeDeepCopyFromShallowCopy(), and replaceGaussian().

real PLearn::GaussMix::sigma_min
 

Definition at line 111 of file GaussMix.h.

Referenced by computeLogLikelihood(), generateFromGaussian(), precomputeStuff(), and updateFromConditionalSorting().

string PLearn::GaussMix::type
 

Definition at line 112 of file GaussMix.h.

Referenced by build_(), computeLogLikelihood(), computeMeansAndCovariances(), expectation(), generateFromGaussian(), precomputeStuff(), replaceGaussian(), resizeStuffBeforeTraining(), setInput(), and updateFromConditionalSorting().

Mat PLearn::GaussMix::updated_weights [protected]
 

A matrix whose j-th line is a Vec with the weights of each sample s_i, multiplied by the posterior P(j | s_i).

Definition at line 98 of file GaussMix.h.

Referenced by computeMeansAndCovariances(), makeDeepCopyFromShallowCopy(), resizeStuffBeforeTraining(), and updateSampleWeights().

Vec PLearn::GaussMix::x_minus_mu_x [mutable, private]
 

Definition at line 57 of file GaussMix.h.

Referenced by makeDeepCopyFromShallowCopy(), and setInput().

TVec<Mat> PLearn::GaussMix::y_x_mat [protected]
 

The product K2 * K1^-1 to compute E[Y|x].

Definition at line 86 of file GaussMix.h.

Referenced by build_(), setInput(), and updateFromConditionalSorting().


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