mlpack
Functions
gmm_test.cpp File Reference
#include <mlpack/core.hpp>
#include <mlpack/methods/gmm/gmm.hpp>
#include <mlpack/methods/gmm/diagonal_gmm.hpp>
#include <mlpack/methods/gmm/no_constraint.hpp>
#include <mlpack/methods/gmm/positive_definite_constraint.hpp>
#include <mlpack/methods/gmm/diagonal_constraint.hpp>
#include <mlpack/methods/gmm/eigenvalue_ratio_constraint.hpp>
#include "test_catch_tools.hpp"
#include "catch.hpp"
Include dependency graph for gmm_test.cpp:

Functions

 TEST_CASE ("GMMProbabilityTest", "[GMMTest]")
 Test GMM::Probability() with a single observation at a time for a few cases.
 
 TEST_CASE ("GMMProbabilityComponentTest", "[GMMTest]")
 Test GMM::Probability() for a single observation being from a particular component.
 
 TEST_CASE ("GMMTrainEMOneGaussian", "[GMMTest]")
 Test training a model on only one Gaussian (randomly generated) in two dimensions. More...
 
 TEST_CASE ("GMMTrainEMMultipleGaussians", "[GMMTest]")
 Test a training model on multiple Gaussians in higher dimensionality than two. More...
 
 TEST_CASE ("GMMTrainEMSingleGaussianWithProbability", "[GMMTest]")
 Train a single-gaussian mixture, but using the overload of Train() where probabilities of the observation are given.
 
 TEST_CASE ("GMMTrainEMMultipleGaussiansWithProbability", "[GMMTest]")
 Train a multi-Gaussian mixture, using the overload of Train() where probabilities of the observation are given.
 
 TEST_CASE ("GMMRandomTest", "[GMMTest]")
 Make sure generating observations randomly works. More...
 
 TEST_CASE ("GMMClassifyTest", "[GMMTest]")
 Test classification of observations by component.
 
 TEST_CASE ("GMMLoadSaveTest", "[GMMTest]")
 
 TEST_CASE ("NoConstraintTest", "[GMMTest]")
 
 TEST_CASE ("PositiveDefiniteConstraintTest", "[GMMTest]")
 
 TEST_CASE ("DiagonalConstraintTest", "[GMMTest]")
 
 TEST_CASE ("EigenvalueRatioConstraintTest", "[GMMTest]")
 
 TEST_CASE ("UseExistingModelTest", "[GMMTest]")
 
 TEST_CASE ("DiagonalGMMProbabilityComponentTest", "[GMMTest]")
 Diagonal Gaussian Mixture Model(DiagonalGMM) Tests. More...
 
 TEST_CASE ("DiagonalGMMTrainEMOneGaussian", "[GMMTest]")
 Make sure we can train a model on only one Gaussian (randomly generated) in two dimensions. More...
 
 TEST_CASE ("DiagonalGMMTrainEMOneGaussianWithProbability", "[GMMTest]")
 Make sure we can train a single Gaussian Mixture Model with diagonal covariance reasonably using Train() where probabilities of the observation are given. More...
 
 TEST_CASE ("DiagonalGMMTrainEMMultipleGaussians", "[GMMTest]")
 Make sure we can train multiple Gaussian Mixture Models with diagonal covariance reasonably. More...
 
 TEST_CASE ("DiagonalGMMTrainEMMultipleGaussiansWithProbability", "[GMMTest]")
 Make sure we can train multiple Gaussian Mixture Models with diagonal covariance reasonably using Train() where probabilities of the observation are given. More...
 
 TEST_CASE ("DiagonalGMMRandomTest", "[GMMTest]")
 Make sure generating observations randomly works. More...
 
 TEST_CASE ("DiagonalGMMLoadSaveTest", "[GMMTest]")
 Make sure load and save DiagonalGMM correctly.
 

Detailed Description

Author
Ryan Curtin
Michael Fox

Test for the Gaussian Mixture Model class.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Function Documentation

◆ TEST_CASE() [1/9]

TEST_CASE ( "GMMTrainEMOneGaussian"  ,
""  [GMMTest] 
)

Test training a model on only one Gaussian (randomly generated) in two dimensions.

We will vary the dataset size from small to large. The EM algorithm is used for training the GMM.

◆ TEST_CASE() [2/9]

TEST_CASE ( "GMMTrainEMMultipleGaussians"  ,
""  [GMMTest] 
)

Test a training model on multiple Gaussians in higher dimensionality than two.

We will hold the dataset size constant at 10k points. The EM algorithm is used for training the GMM.

◆ TEST_CASE() [3/9]

TEST_CASE ( "GMMRandomTest"  ,
""  [GMMTest] 
)

Make sure generating observations randomly works.

We'll do this by generating a bunch of random observations and then re-training on them, and hope that our model is the same.

◆ TEST_CASE() [4/9]

TEST_CASE ( "DiagonalGMMProbabilityComponentTest"  ,
""  [GMMTest] 
)

Diagonal Gaussian Mixture Model(DiagonalGMM) Tests.

Make sure Diagonal::Probability() of a specific Gaussian component works correctly in single observation.

◆ TEST_CASE() [5/9]

TEST_CASE ( "DiagonalGMMTrainEMOneGaussian"  ,
""  [GMMTest] 
)

Make sure we can train a model on only one Gaussian (randomly generated) in two dimensions.

We will vary the dataset size from small to large. The EM algorithm is used for training the DiagonalGMM.

◆ TEST_CASE() [6/9]

TEST_CASE ( "DiagonalGMMTrainEMOneGaussianWithProbability"  ,
""  [GMMTest] 
)

Make sure we can train a single Gaussian Mixture Model with diagonal covariance reasonably using Train() where probabilities of the observation are given.

The EM algorithm is used for training the DiagonalGMM.

◆ TEST_CASE() [7/9]

TEST_CASE ( "DiagonalGMMTrainEMMultipleGaussians"  ,
""  [GMMTest] 
)

Make sure we can train multiple Gaussian Mixture Models with diagonal covariance reasonably.

The EM algorithm is used for training the DiagonalGMM.

◆ TEST_CASE() [8/9]

TEST_CASE ( "DiagonalGMMTrainEMMultipleGaussiansWithProbability"  ,
""  [GMMTest] 
)

Make sure we can train multiple Gaussian Mixture Models with diagonal covariance reasonably using Train() where probabilities of the observation are given.

The EM algorithm is used for training the DiagonalGMM.

◆ TEST_CASE() [9/9]

TEST_CASE ( "DiagonalGMMRandomTest"  ,
""  [GMMTest] 
)

Make sure generating observations randomly works.

We'll do this by generating a bunch of random observations and then re-training on them, and hope that our model is the same.