Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

Diagonal/spherical covariance GMMs have no covariance variable #25

Description

@MacDaddio

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))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions