I am trying to make an GMM of Audio data. Therefore, I do an Mel Frequency Cepstral Coefficient analysis for each sample and store the data in an array:
double[][] data;
Then I do initialize the gmm with KMeans.
When I try to make the gmm I get an NonPositiveDefiniteMatrixException at the compute call.
double[] weights = { 1, 3, 5, 4, 3, 5, 10, 17, 12, 6, 3, 1, 0 };
int numberClusters = 11;
KMeans kmeans = new KMeans(numberClusters);
kmeans.Compute(melFrequencies, 0.0001);
GaussianMixtureModel gmm = new GaussianMixtureModel(numberClusters);
if (kmeans != null) gmm.Initialize(kmeans);
gmm.Compute(melFrequencies, new GaussianMixtureModelOptions()
{
//Weights = weights
});
int[] classifications = gmm.Gaussians.Nearest(melFrequencies);
Please, help me I really don't know how to get this running.
Thanks & Best regards,
James
double[] weights = { 1, 3, 5, 4, 3, 5, 10, 17, 12, 6, 3, 1, 0 };
int numberClusters = 11;
KMeans kmeans = new KMeans(numberClusters);
kmeans.Compute(melFrequencies, 0.0001);
GaussianMixtureModel gmm = new GaussianMixtureModel(numberClusters);
if (kmeans != null) gmm.Initialize(kmeans);
gmm.Compute(melFrequencies, new GaussianMixtureModelOptions()
{
//Weights = weights
NormalOptions = new NormalOptions()
{
Robust = true;
}
});
int[] classifications = gmm.Gaussians.Nearest(melFrequencies);thanks that solved the problem with getting the gmm run.
One thing I wonder still wonder:
The calculated classifactions have all the same integer as a result.
I guess I still do something wrong...
Thanks, James
gmm.Compute(melFrequencies, new GaussianMixtureModelOptions()
{
//Weights = weights
Logarithm = true,
NormalOptions = new NormalOptions()
{
Regularization = 1e-1,
Robust = false
}
});
That seems to work a bit better.
One thing that I still think is strange. Maybe you can help me to understand this better. Kmeans and GMM both give me classifications. Although I defined the number of clusters (11) the only computed the values are 1-7 or 8 that can be found in the classifications array can be found.
Any clue why?
Thanks for leading me through this lines of code :)