gmtorch package#
Module contents#
Gaussian Mixture.
- class gmtorch.GaussianMixture(n_components: int = 1, dim: int = 1, weights: Tensor | None = None, means: Tensor | None = None, covariances: Tensor | None = None, device: device | str = 'cpu')[source]#
Bases:
objectGaussian Mixture Class.
Parameters (6): - n_components (int) - dim (int) - weights (Tensor) shape (n_components,) - means (Tensor) shape (n_components, dim) - covariances (Tensor) shape (n_components, dim, dim) - device (torch.device or str)
- covariance() Tensor[source]#
Compute the covariance matrix of the Gaussian Mixture.
- Returns:
- Tensor
- Return type:
covariance matrix of shape (dim, dim)
- expectation() Tensor[source]#
Compute the expectation value of the Gaussian Mixture.
- Returns:
- Tensor
- Return type:
expectation value of shape (dim)