# tf.contrib.factorization.GmmAlgorithm

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L92-L459) |

Tensorflow Gaussian mixture model clustering class.

    tf.contrib.factorization.GmmAlgorithm(
        data, num_classes, initial_means=None, params='wmc',
        covariance_type=FULL_COVARIANCE, random_seed=0
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `data` | a list of Tensors with data, each row is a new example. |
| `num_classes` | number of clusters. |
| `initial_means` | a Tensor with a matrix of means. If None, means are computed by sampling randomly. |
| `params` | Controls which parameters are updated in the training process. Can contain any combination of "w" for weights, "m" for means, and "c" for covariances. |
| `covariance_type` | one of "full", "diag". |
| `random_seed` | Seed for PRNG used to initialize seeds. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| Exception if covariance type is unknown. ||

<br />

## Methods

### `alphas`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L235-L236)

    alphas()

### `assignments`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L246-L251)

    assignments()

Returns a list of Tensors with the matrix of assignments per shard.

### `clusters`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L238-L240)

    clusters()

Returns the clusters with dimensions num_classes X 1 X num_dimensions.

### `covariances`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L242-L244)

    covariances()

Returns the covariances matrices.

### `init_ops`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L223-L225)

    init_ops()

Returns the initialization operation.

### `is_initialized`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L231-L233)

    is_initialized()

Returns a boolean operation for initialized variables.

### `log_likelihood_op`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L261-L263)

    log_likelihood_op()

Returns the log-likelihood operation.

### `scores`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L253-L259)

    scores()

Returns the per-sample likelihood fo the data.

<br />

<br />

<br />

| Returns ||
|---|---|
| Log probabilities of each data point. ||

<br />

### `training_ops`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L227-L229)

    training_ops()

Returns the training operation.

## Class Variables

- `CLUSTERS_COVS_VARIABLE = 'clusters_covs'`
- `CLUSTERS_VARIABLE = 'clusters'`
- `CLUSTERS_WEIGHT = 'alphas'`