Skip to content

Commit 5041440

Browse files
author
Alexander Ororbia
committed
cleaned up density structure, use parent mixture class to organize model variations
1 parent 716d62e commit 5041440

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

docs/source/ngclearn.utils.density.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ ngclearn.utils.density package
44
Submodules
55
----------
66

7-
ngclearn.utils.density.bmm module
8-
---------------------------------
7+
ngclearn.utils.density.bernoulliMixture module
8+
----------------------------------------------
99

10-
.. automodule:: ngclearn.utils.density.bmm
10+
.. automodule:: ngclearn.utils.density.bernoulliMixture
1111
:members:
1212
:undoc-members:
1313
:show-inheritance:
1414

15-
ngclearn.utils.density.gmm module
16-
---------------------------------
15+
ngclearn.utils.density.gaussianMixture module
16+
---------------------------------------------
1717

18-
.. automodule:: ngclearn.utils.density.gmm
18+
.. automodule:: ngclearn.utils.density.gaussianMixture
1919
:members:
2020
:undoc-members:
2121
:show-inheritance:

docs/tutorials/neurocog/density_modeling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The following Python code will employ an NGC-Learn-in-built GMM density estimato
1111

1212
```python
1313
from jax import numpy as jnp, random
14-
from ngclearn.utils.density.gmm import GMM ## pull out the mixture model density estimator
14+
from ngclearn.utils.density.gaussianMixture import GaussianMixture as GMM ## pull out density estimator
1515

1616
def gen_data(dkey, n_samp_per_mode): ## data generator (or proxy stochastic data generating process)
1717
scale = 0.3

ngclearn/utils/density/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .mixture import Mixture ## general mixture template parent class
22
## point to supported density estimator models
3-
from .gmm import GMM ## Gaussian mixture model
4-
from .bmm import BMM ## Bernoulli mixture model
3+
from .gaussianMixture import GaussianMixture ## Gaussian mixture model
4+
from .bernoulliMixture import BernoulliMixture ## Bernoulli mixture model
55

ngclearn/utils/density/bmm.py renamed to ngclearn/utils/density/bernoulliMixture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _sample_component(dkey, n_samples, mu): ## samples a component (of mixture)
6060

6161
########################################################################################################################
6262

63-
class BMM(Mixture): ## Bernoulli mixture model (mixture-of-Bernoullis)
63+
class BernoulliMixture(Mixture): ## Bernoulli mixture model (mixture-of-Bernoullis)
6464
"""
6565
Implements a Bernoulli mixture model (BMM) -- or mixture of Bernoullis (MoB).
6666
Adaptation of parameters is conducted via the Expectation-Maximization (EM)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _sample_component(dkey, n_samples, mu, Sigma, assume_diag_cov=False): ## sam
101101

102102
########################################################################################################################
103103

104-
class GMM(Mixture): ## Gaussian mixture model (mixture-of-Gaussians)
104+
class GaussianMixture(Mixture): ## Gaussian mixture model (mixture-of-Gaussians)
105105
"""
106106
Implements a Gaussian mixture model (GMM) -- or mixture of Gaussians (MoG).
107107
Adaptation of parameters is conducted via the Expectation-Maximization (EM)

0 commit comments

Comments
 (0)