pycave
pycave copied to clipboard
Diagonal/spherical covariance GMMs have no covariance variable
Hello:
The title kind of says it all. The gmm.model_.covariances variable is None for some reason for both of these models. I don't think this was the case in the past so maybe one of the last commits had a bug. Unless this is intentional?
Here is a minal working example:
from pycave.bayes import GaussianMixture import torch import numpy as np import pycave import random import time
#Set seed seed = 0 torch.manual_seed(seed) torch.cuda.manual_seed(seed) random.seed(seed)
#Inputs d = 10 k = 1 n = 1000
#Data x = torch.randn(n,d)
#Fit PyCave GMM gmm = GaussianMixture(num_components=k, covariance_type='diag', init_strategy='kmeans', trainer_params={'gpus':1,'enable_progress_bar':True, 'logger':True}, covariance_regularization=1e-6) gmm = gmm.fit(x)
print(type(gmm.model_.covariances))