shared.stat.ml
Class GMModel

java.lang.Object
  extended by shared.stat.ml.AbstractGMModel
      extended by shared.stat.ml.GMModel

public class GMModel
extends AbstractGMModel

An implementation of AbstractGMModel using EM updates on GMM's with diagonal covariances. Inspired by Lawrence Saul's EM code.


Constructor Summary
GMModel()
          Default constructor.
 
Method Summary
 RealArray computeLogWeightedDensities(GMComponents gmc, RealArray points)
          Computes the log of the weighted densities.
 GMComponents initialize(RealArray input, int ncomps, double regularization)
          Initializes the mixture components.
 void update(GMComponents gmc, RealArray posterior, RealArray points, double regularization)
          Performs the update rule.
 
Methods inherited from class shared.stat.ml.AbstractGMModel
computePosterior, train
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMModel

public GMModel()
Default constructor.

Method Detail

initialize

public GMComponents initialize(RealArray input,
                               int ncomps,
                               double regularization)
Description copied from class: AbstractGMModel
Initializes the mixture components.

Specified by:
initialize in class AbstractGMModel
Parameters:
input - the input.
ncomps - the number of components.
regularization - the regularization hint.
Returns:
the initial mixture components.

update

public void update(GMComponents gmc,
                   RealArray posterior,
                   RealArray points,
                   double regularization)
Description copied from class: AbstractGMModel
Performs the update rule.

Specified by:
update in class AbstractGMModel
Parameters:
gmc - the mixture components.
posterior - the posterior distribution p(components | points).
points - the input.
regularization - the regularization hint.

computeLogWeightedDensities

public RealArray computeLogWeightedDensities(GMComponents gmc,
                                             RealArray points)
Description copied from class: AbstractGMModel
Computes the log of the weighted densities.

Specified by:
computeLogWeightedDensities in class AbstractGMModel
Parameters:
gmc - the mixture components.
points - the input.
Returns:
the log of p(points | components).