bob.machine.GMMMachine

class bob.machine.GMMMachine((object)self) → None

Bases: bob.machine._machine.MachineDoubleBase

This class implements a multivariate diagonal Gaussian distribution. See Section 2.3.9 of Bishop, “Pattern recognition and machine learning”, 2006

__init__( (object)self, (int)n_gaussians, (int)n_inputs) -> None

__init__( (object)self, (GMMMachine)other) -> None :
Creates a GMMMachine from another GMMMachine, using the copy constructor.

__init__( (object)self, (HDF5File)config) -> None

__init__((object)self) → None

__init__( (object)self, (int)n_gaussians, (int)n_inputs) -> None

__init__( (object)self, (GMMMachine)other) -> None :
Creates a GMMMachine from another GMMMachine, using the copy constructor.

__init__( (object)self, (HDF5File)config) -> None

Methods

__init__((object)self) __init__( (object)self, (int)n_gaussians, (int)n_inputs) -> None
acc_statistics((GMMMachine)self, (object)x, …) Accumulate the GMM statistics for this sample(s).
acc_statistics_((GMMMachine)self, (object)x, …) Accumulate the GMM statistics for this sample(s).
forward((MachineDoubleBase)self, (object)input) Executes the machine on the given 1D numpy array of float64, and returns the output.
forward_((MachineDoubleBase)self, (object)input) Executes the machine on the given 1D numpy array of float64, and returns the output.
is_similar_to((GMMMachine)self, …) Compares this GMMMachine with the ‘other’ one to be approximately the same.
load((GMMMachine)self, (HDF5File)config) Load from a Configuration
log_likelihood((GMMMachine)self, (object)x, …) Output the log likelihood of the sample, x, i.e.
log_likelihood_((GMMMachine)self, (object)x, …) Output the log likelihood of the sample, x, i.e.
resize((GMMMachine)self, (int)n_gaussians, …) Reset the input dimensionality, and the number of Gaussian components.
save((GMMMachine)self, (HDF5File)config) Save to a Configuration
set_variance_thresholds((GMMMachine)self, …) Set the variance flooring thresholds in each dimension to the same vector for all Gaussian components if the argument is a 1D numpy arrray, and equal for all Gaussian components and dimensions if the parameter is a scalar.
update_gaussian((GMMMachine)self, (int)i) Get the specified Gaussian component.

Attributes

dim_c The number of Gaussian components C
dim_d The feature dimensionality D
mean_supervector The mean supervector of the GMMMachine (concatenation of the mean vectors of each Gaussian of the GMMMachine
means The means of the gaussians
shape A tuple that represents the dimensionality of the GMMMachine (n_gaussians, n_inputs).
variance_supervector The variance supervector of the GMMMachine (concatenation of the variance vectors of each Gaussian of the GMMMachine
variance_thresholds The variance flooring thresholds for each Gaussian in each dimension
variances The (diagonal) variances of the Gaussians
weights The weights (also known as “mixing coefficients”)
__call__((MachineDoubleBase)self, (object)input) → float :

Executes the machine on the given 1D numpy array of float64, and returns the output. NO CHECK is performed.

acc_statistics((GMMMachine)self, (object)x, (GMMStats)stats) → None :

Accumulate the GMM statistics for this sample(s). Inputs are checked.

acc_statistics_((GMMMachine)self, (object)x, (GMMStats)stats) → None :

Accumulate the GMM statistics for this sample(s). Inputs are NOT checked.

dim_c

The number of Gaussian components C

dim_d

The feature dimensionality D

forward((MachineDoubleBase)self, (object)input) → float :

Executes the machine on the given 1D numpy array of float64, and returns the output.

forward_((MachineDoubleBase)self, (object)input) → float :

Executes the machine on the given 1D numpy array of float64, and returns the output. NO CHECK is performed.

is_similar_to((GMMMachine)self, (GMMMachine)other[, (float)r_epsilon=1e-05[, (float)a_epsilon=1e-08]]) → bool :

Compares this GMMMachine with the ‘other’ one to be approximately the same.

load((GMMMachine)self, (HDF5File)config) → None :

Load from a Configuration

log_likelihood((GMMMachine)self, (object)x, (object)log_weighted_gaussian_likelihoods) → float :

Output the log likelihood of the sample, x, i.e. log(p(x|bob::machine::GMMMachine)). Inputs are checked.

log_likelihood( (GMMMachine)self, (object)x) -> float :
Output the log likelihood of the sample, x, i.e. log(p(x|GMM)). Inputs are checked.
log_likelihood_((GMMMachine)self, (object)x, (object)log_weighted_gaussian_likelihoods) → float :

Output the log likelihood of the sample, x, i.e. log(p(x|bob::machine::GMMMachine)). Inputs are NOT checked.

log_likelihood_( (GMMMachine)self, (object)x) -> float :
Output the log likelihood of the sample, x, i.e. log(p(x|GMM)). Inputs are checked.
mean_supervector

The mean supervector of the GMMMachine (concatenation of the mean vectors of each Gaussian of the GMMMachine

means

The means of the gaussians

resize((GMMMachine)self, (int)n_gaussians, (int)n_inputs) → None :

Reset the input dimensionality, and the number of Gaussian components. Initialises the weights to uniform distribution.

save((GMMMachine)self, (HDF5File)config) → None :

Save to a Configuration

set_variance_thresholds((GMMMachine)self, (object)variance_threshold) → None :

Set the variance flooring thresholds in each dimension to the same vector for all Gaussian components if the argument is a 1D numpy arrray, and equal for all Gaussian components and dimensions if the parameter is a scalar.

shape

A tuple that represents the dimensionality of the GMMMachine (n_gaussians, n_inputs).

update_gaussian((GMMMachine)self, (int)i) → Gaussian :

Get the specified Gaussian component. An exception is thrown if i is out of range.

variance_supervector

The variance supervector of the GMMMachine (concatenation of the variance vectors of each Gaussian of the GMMMachine

variance_thresholds

The variance flooring thresholds for each Gaussian in each dimension

variances

The (diagonal) variances of the Gaussians

weights

The weights (also known as “mixing coefficients”)