Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ldeecke/gmm-torch
Gaussian mixture models in PyTorch.
https://github.com/ldeecke/gmm-torch
gaussian-mixture-models pytorch
Last synced: 3 months ago
JSON representation
Gaussian mixture models in PyTorch.
- Host: GitHub
- URL: https://github.com/ldeecke/gmm-torch
- Owner: ldeecke
- License: mit
- Created: 2018-06-13T10:26:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-15T15:03:42.000Z (over 1 year ago)
- Last Synced: 2024-07-04T00:55:14.888Z (4 months ago)
- Topics: gaussian-mixture-models, pytorch
- Language: Python
- Homepage:
- Size: 568 KB
- Stars: 493
- Watchers: 3
- Forks: 86
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
This repository contains an implementation of a simple **Gaussian mixture model** (GMM) fitted with Expectation-Maximization in [pytorch](http://www.pytorch.org). The interface closely follows that of [sklearn](http://scikit-learn.org).
![Example of a fit via a Gaussian Mixture model.](example.png)
---
A new model is instantiated by calling `gmm.GaussianMixture(..)` and providing as arguments the number of components, as well as the tensor dimension. Note that once instantiated, the model expects tensors in a flattened shape `(n, d)`.
The first step would usually be to fit the model via `model.fit(data)`, then predict with `model.predict(data)`. To reproduce the above figure, just run the provided `example.py`.
Some sanity checks can be executed by calling `python test.py`. To fit data on GPUs, ensure that you first call `model.cuda()`.