kaldi.gmm¶
Functions
augment_gmm_flags |
Calls C++ function |
get_split_targets |
Calls C++ function |
gmm_flags_to_string |
Calls C++ function |
mle_full_gmm_update |
Calls C++ function |
string_to_gmm_flags |
Calls C++ function |
string_to_sgmm_update_flags |
Calls C++ function |
string_to_sgmm_write_flags |
Calls C++ function |
Classes
AccumDiagGmm |
CLIF wrapper for ::kaldi::AccumDiagGmm |
AccumFullGmm |
CLIF wrapper for ::kaldi::AccumFullGmm |
DiagGmm |
Gaussian Mixture Model with diagonal covariances. |
FullGmm |
Python wrapper for Kaldi::FullGmm<Float> |
FullGmmNormal |
CLIF wrapper for ::kaldi::FullGmmNormal |
GmmUpdateFlags |
An enumeration. |
MapDiagGmmOptions |
CLIF wrapper for ::kaldi::MapDiagGmmOptions |
MleDiagGmmOptions |
CLIF wrapper for ::kaldi::MleDiagGmmOptions |
MleFullGmmOptions |
CLIF wrapper for ::kaldi::MleFullGmmOptions |
SgmmUpdateFlags |
An enumeration. |
SgmmWriteFlags |
An enumeration. |
-
class
kaldi.gmm.
AccumDiagGmm
¶ CLIF wrapper for ::kaldi::AccumDiagGmm
-
accumulate_for_component
(data:VectorBase, comp_index:int, weight:float)¶ Calls C++ function void ::kaldi::AccumDiagGmm::AccumulateForComponent(::kaldi::VectorBase<float>, int, float)
-
accumulate_from_diag
(gmm:DiagGmm, data:VectorBase, frame_posterior:float) → float¶ Calls C++ function float ::kaldi::AccumDiagGmm::AccumulateFromDiag(::kaldi::DiagGmm, ::kaldi::VectorBase<float>, float)
-
accumulate_from_diag_multi_threaded
(gmm:DiagGmm, data:MatrixBase, frame_weights:VectorBase, num_threads:int) → float¶ Calls C++ function float ::kaldi::AccumDiagGmm::AccumulateFromDiagMultiThreaded(::kaldi::DiagGmm, ::kaldi::MatrixBase<float>, ::kaldi::VectorBase<float>, int)
-
accumulate_from_posteriors
(data:VectorBase, gauss_posteriors:VectorBase)¶ Calls C++ function void ::kaldi::AccumDiagGmm::AccumulateFromPosteriors(::kaldi::VectorBase<float>, ::kaldi::VectorBase<float>)
-
add
(scale:float, acc:AccumDiagGmm)¶ Calls C++ function void ::kaldi::AccumDiagGmm::Add(double, ::kaldi::AccumDiagGmm)
-
add_stats_for_component
(comp_id:int, occ:float, x_stats:DoubleVectorBase, x2_stats:DoubleVectorBase)¶ Calls C++ function void ::kaldi::AccumDiagGmm::AddStatsForComponent(int, double, ::kaldi::VectorBase<double>, ::kaldi::VectorBase<double>)
-
assert_equal
(other:AccumDiagGmm)¶ Calls C++ function void ::kaldi::AccumDiagGmm::AssertEqual(::kaldi::AccumDiagGmm)
-
dim
() → int¶ Calls C++ function int ::kaldi::AccumDiagGmm::Dim()
-
flags_
¶ C++ clif_type_56 AccumDiagGmm.Flags()
-
new
(gmm:DiagGmm, flags:int) → AccumDiagGmm¶ Calls C++ function std::unique_ptr<::kaldi::AccumDiagGmm> ::kaldi::AccumDiagGmm::AccumDiagGmm(::kaldi::DiagGmm, unsigned short)
-
num_gauss
() → int¶ Calls C++ function int ::kaldi::AccumDiagGmm::NumGauss()
-
read
(in_stream:istream, binary:bool, add:bool)¶ Calls C++ function void ::kaldi::AccumDiagGmm::Read(::std::basic_istream<char, ::std::char_traits<char> >, bool, bool)
-
resize
(num_gauss:int, dim:int, flags:int)¶ Calls C++ function void ::kaldi::AccumDiagGmm::Resize(int, int, unsigned short)
-
resize_with_gmm
(gmm:DiagGmm, flags:int)¶ Calls C++ function void ::kaldi::AccumDiagGmm::Resize(::kaldi::DiagGmm, unsigned short)
-
scale
(f:float, flags:int)¶ Calls C++ function void ::kaldi::AccumDiagGmm::Scale(float, unsigned short)
-
set_zero
(flags:int)¶ Calls C++ function void ::kaldi::AccumDiagGmm::SetZero(unsigned short)
-
smooth_stats
(tau:float)¶ Calls C++ function void ::kaldi::AccumDiagGmm::SmoothStats(float)
-
smooth_with_accum
(tau:float, src_acc:AccumDiagGmm)¶ Calls C++ function void ::kaldi::AccumDiagGmm::SmoothWithAccum(float, ::kaldi::AccumDiagGmm)
-
smooth_with_model
(tau:float, src_gmm:DiagGmm)¶ Calls C++ function void ::kaldi::AccumDiagGmm::SmoothWithModel(float, ::kaldi::DiagGmm)
-
with_other
(other:AccumDiagGmm) → AccumDiagGmm¶ Calls C++ function std::unique_ptr<::kaldi::AccumDiagGmm> ::kaldi::AccumDiagGmm::AccumDiagGmm(::kaldi::AccumDiagGmm)
-
write
(out_stream:ostream, binary:bool)¶ Calls C++ function void ::kaldi::AccumDiagGmm::Write(::std::basic_ostream<char, ::std::char_traits<char> >, bool)
-
-
class
kaldi.gmm.
AccumFullGmm
¶ CLIF wrapper for ::kaldi::AccumFullGmm
-
accumulate_for_component
(data:VectorBase, comp_index:int, weight:float)¶ Calls C++ function void ::kaldi::AccumFullGmm::AccumulateForComponent(::kaldi::VectorBase<float>, int, float)
-
accumulate_from_diag
(gmm:DiagGmm, data:VectorBase, frame_posterior:float) → float¶ Calls C++ function float ::kaldi::AccumFullGmm::AccumulateFromDiag(::kaldi::DiagGmm, ::kaldi::VectorBase<float>, float)
-
accumulate_from_full
(gmm:FullGmm, data:VectorBase, frame_posterior:float) → float¶ Calls C++ function float ::kaldi::AccumFullGmm::AccumulateFromFull(::kaldi::FullGmm, ::kaldi::VectorBase<float>, float)
-
accumulate_from_posteriors
(data:VectorBase, gauss_posteriors:VectorBase)¶ Calls C++ function void ::kaldi::AccumFullGmm::AccumulateFromPosteriors(::kaldi::VectorBase<float>, ::kaldi::VectorBase<float>)
-
covariance_accumulator
() → list<DoubleSpMatrix>¶ Calls C++ function ::std::vector< ::kaldi::SpMatrix<double> > ::kaldi::AccumFullGmm::covariance_accumulator()
-
dim
() → int¶ Calls C++ function int ::kaldi::AccumFullGmm::Dim()
-
flags
() → int¶ Calls C++ function unsigned short ::kaldi::AccumFullGmm::Flags()
-
mean_accumulator
() → DoubleMatrix¶ Calls C++ function ::kaldi::Matrix<double> ::kaldi::AccumFullGmm::mean_accumulator()
-
new_with_full
(gmm:FullGmm, flags:int) → AccumFullGmm¶ Calls C++ function std::unique_ptr<::kaldi::AccumFullGmm> ::kaldi::AccumFullGmm::AccumFullGmm(::kaldi::FullGmm, unsigned short)
-
new_with_other
(gmm:AccumFullGmm) → AccumFullGmm¶ Calls C++ function std::unique_ptr<::kaldi::AccumFullGmm> ::kaldi::AccumFullGmm::AccumFullGmm(::kaldi::AccumFullGmm)
-
new_with_params
(num_comp:int, dim:int, flags:int) → AccumFullGmm¶ Calls C++ function std::unique_ptr<::kaldi::AccumFullGmm> ::kaldi::AccumFullGmm::AccumFullGmm(int, int, unsigned short)
-
num_gauss
() → int¶ Calls C++ function int ::kaldi::AccumFullGmm::NumGauss()
-
occupancy
() → DoubleVector¶ Calls C++ function ::kaldi::Vector<double> ::kaldi::AccumFullGmm::occupancy()
-
read
(in_stream:istream, binary:bool, add:bool)¶ Calls C++ function void ::kaldi::AccumFullGmm::Read(::std::basic_istream<char, ::std::char_traits<char> >, bool, bool)
-
resize
(num_comp:int, dim:int, flags:int)¶ Calls C++ function void ::kaldi::AccumFullGmm::Resize(int, int, unsigned short)
-
resize_var_accumulator
(num_comp:int, dim:int)¶ Calls C++ function void ::kaldi::AccumFullGmm::ResizeVarAccumulator(int, int)
-
resize_with_full
(gmm:FullGmm, flags:int)¶ Calls C++ function void ::kaldi::AccumFullGmm::Resize(::kaldi::FullGmm, unsigned short)
-
scale
(f:float, flags:int)¶ Calls C++ function void ::kaldi::AccumFullGmm::Scale(float, unsigned short)
-
set_zero
(flags:int)¶ Calls C++ function void ::kaldi::AccumFullGmm::SetZero(unsigned short)
-
write
(out_stream:ostream, binary:bool)¶ Calls C++ function void ::kaldi::AccumFullGmm::Write(::std::basic_ostream<char, ::std::char_traits<char> >, bool)
-
-
class
kaldi.gmm.
DiagGmm
(nmix=0, dim=0)[source]¶ Gaussian Mixture Model with diagonal covariances.
Parameters: - Creates a new DiagGmm with specified number of gaussian mixtures
- and dimensions.
Parameters: -
component_log_likelihood
(data:VectorBase, comp_id:int) → float¶ Computes the log-likelihood of a data point given a single Gaussian component.
Parameters: - data (
kaldi.matrix.Vector
) – data point - comp_id – component id
Returns: Log-likehood of input data point for a given component
- data (
-
component_posteriors
(data)[source]¶ - Computes the posterior probabilities of all Gaussian components given
- a data point.
Parameters: data (VectorBase) – Data point with the same dimension as each component. Returns: 2-element tuple containing Raises: ValueError if data is not consistent with gmm dimension.
-
compute_gconsts
() → int¶ Sets the gconsts.
Returns: Number of gconsts that are invalid e.g. because of zero weights or variances.
-
copy
(src)[source]¶ Copies data from src into this DiagGmm and returns this DiagGmm.
Parameters: src (FullGmm or DiagGmm) – Source Gmm to copy Returns: This DiagGmm after update.
-
dim
() → int¶ Returns the dimensionality of the Gaussian mean vectors.
-
from_clusterable
(gc:GaussClusterable, var_floor:float) → DiagGmm¶ Creates a new DiagGmm from a GaussClusterable.
-
from_nmix_dim
(nmix:int, dim:int) → DiagGmm¶ Creates a new DiagGmm with given number of mixtures and dimension.
-
from_other
(gmm:DiagGmm) → DiagGmm¶ Creates a new DiagGmm from another DiagGmm.
-
gaussian_selection
(data:VectorBase, num_gselect:int) -> (log_like:float, output:list<int>)¶ Gets gaussian selection information for one frame.
Parameters: - data (
kaldi.matrix.Vector
) – data point - num_gselect (int) – number of gaussians to select
Returns: Log-likelihood for the input frame and the best
num_gselect
indices (sorted from best to worst likelihood).- data (
-
gaussian_selection_matrix
(data:MatrixBase, num_gselect:int) -> (log_like:float, output:list<list<int>>)¶ Gets gaussian selection information for a sequence of frames.
Parameters: - data (
kaldi.matrix.Matrix
) – sequence of data points - num_gselect (int) – number of gaussians to select
Returns: Log-likelihood for the input frame and the best
num_gselect
indices (sorted from best to worst likelihood) for each data point.- data (
-
gaussian_selection_preselect
(data:VectorBase, preselect:list<int>, num_gselect:int) -> (log_like:float, output:list<int>)¶ Get gaussian selection information for one frame.
Parameters: - data (
kaldi.matrix.Vector
) – data point - preselect (list) – subset of mixture components
- num_gselect (int) – number of gaussians to select
Returns: Log-likelihood for the input frame and the best
num_gselect
indices that were preselected (sorted from best to worst likelihood).- data (
-
gconsts
() → Vector¶ Returns gconsts
-
generate
(output:VectorBase)¶ Generates a random data point from this distribution.
Parameters: output ( kaldi.matrix.Vector
) – Output vector
-
get_component_mean
(gauss:int, out:VectorBase)¶ Gets component mean.
-
get_component_variance
(gauss:int, out:VectorBase)¶ Gets component variance.
-
get_means
() → Matrix¶ Returns component means.
-
get_vars
() → Matrix¶ Returns component variances.
-
interpolate
(rho:float, source:DiagGmm, flags:int=default)¶ Interpolates this model with diagonal GMM
this <- rho * source + (1 - rho) * this
Parameters:
-
interpolate_full
(rho:float, source:FullGmm, flags:int=default)¶ Interpolates this model with full GMM
this <- rho * source + (1 - rho) * this
Parameters:
-
inv_vars
() → Matrix¶ Returns inverse variances
-
log_likelihood
(data:VectorBase) → float¶ Computes the log-likelihood for a data point
Parameters: data ( kaldi.matrix.Vector
) – data point
-
log_likelihoods
(data:VectorBase) → Vector¶ Computes the per-component log-likelihoods for a data point
Parameters: data ( kaldi.matrix.Vector
) – data point
-
log_likelihoods_matrix
(data:MatrixBase) → Matrix¶ Computes the per-component log-likelihoods for a sequence of data points
The row index of the input data matrix and the output log-likelihoods matrix is the frame index.
Parameters: data ( kaldi.matrix.Matrix
) – sequence of data points
-
log_likelihoods_preselect
(data:VectorBase, indices:list<int>) → Vector¶ Computes the per-component log-likelihoods of a subset of mixture components.
Parameters: - data (
kaldi.matrix.Vector
) – data point - indices – list of indices
- data (
-
means_invvars
() → Matrix¶ Returns means times inverse variances
-
merge
(target_components:int) → list<int>¶ Merges components
Parameters: target_components (int) – number of target components Returns: The order in which components were merged.
-
num_gauss
() → int¶ Returns the number of mixture components.
-
perturb
(perturb_factor:float)¶ Perturbs components
Component means are perturbed with a random vector multiplied by the pertrubation factor.
Parameters: perturb_factor (float) – perturbation factor
-
read
(is:istream, binary:bool)¶ Reads gaussian mixture model from input stream.
-
remove_component
(gauss:int, renorm_weights:bool)¶ Removes single component from model.
-
remove_components
(gauss:list<int>, renorm_weights:bool)¶ Removes multiple components from model.
-
resize
(nmix:int, dim:int)¶ Resizes arrays to this dim. Does not initialize data.
-
set_component_inv_var
(gauss:int, in:VectorBase)¶ Sets inv-var for a single component.
-
set_component_mean
(gauss:int, in:VectorBase)¶ Sets mean for a single component.
Internally multiplies with inv-var.
-
set_component_weight
(gauss:int, weight:float)¶ Sets mixture weight for a single component.
-
set_inv_vars
(v:MatrixBase)¶ Sets inverse variances.
-
set_inv_vars_and_means
(invvars:MatrixBase, means:MatrixBase)¶ Sets inverse variances and means.
-
set_means
(m:MatrixBase)¶ Sets means.
-
set_weights
(w:VectorBase)¶ Sets mixture weights.
-
split
(target_components:int, perturb_factor:float) → list<int>¶ Splits components
Parameters: Returns: The order in which components were split.
-
valid_gconsts
() → bool¶ Checks if gconsts are valid
-
weights
() → Vector¶ Returns mixture weights
-
write
(os:ostream, binary:bool)¶ Writes gaussian mixture model to output stream.
-
class
kaldi.gmm.
FullGmm
(nmix=0, dim=0)[source]¶ Python wrapper for Kaldi::FullGmm<Float>
Provides a more pythonic access to the C++ methods.
Parameters: Raises: ValueError if nmix or dimension are not positive integers.
Creates a new FullGmm with specified number of gaussian mixtures and dimensions.
Parameters: -
component_log_likelihood
(data:VectorBase, comp_id:int) → float¶ Computes the log-likelihood of a data point given a single Gaussian component.
Parameters: - data (
kaldi.matrix.Vector
) – data point - comp_id – component id
Returns: Log-likehood of input data point for a given component
- data (
-
component_posteriors
(data)[source]¶ - Computes the posterior probabilities of all Gaussian components given
- a data point.
Parameters: data (VectorBase) – Data point with the same dimension as each component. Returns: 2-element tuple containing Raises: ValueError if data is not consistent with gmm dimension.
-
compute_gconsts
() → int¶ Sets the gconsts.
Returns: Number of gconsts that are invalid e.g. because of zero weights or variances.
-
copy
(src)[source]¶ Copies data from src into this FullGmm and returns this FullGmm.
Parameters: src (FullGmm or DiagGmm) – Source Gmm to copy Returns: This FullGmm after update.
-
dim
() → int¶ Returns the dimensionality of the Gaussian mean vectors.
-
from_nmix_dim
(nmix:int, dim:int) → FullGmm¶ Calls C++ function std::unique_ptr<::kaldi::FullGmm> ::kaldi::FullGmm::FullGmm(int, int)
-
from_other
(gmm:FullGmm) → FullGmm¶ Calls C++ function std::unique_ptr<::kaldi::FullGmm> ::kaldi::FullGmm::FullGmm(::kaldi::FullGmm)
-
gaussian_selection
(data:VectorBase, num_gselect:int) -> (log_like:float, output:list<int>)¶ Gets gaussian selection information for one frame.
Parameters: - data (
kaldi.matrix.Vector
) – data point - num_gselect (int) – number of gaussians to select
Returns: Log-likelihood for the input frame and the best
num_gselect
indices (sorted from best to worst likelihood).- data (
-
gaussian_selection_preselect
(data:VectorBase, preselect:list<int>, num_gselect:int) -> (log_like:float, posteriors:list<int>)¶ Get gaussian selection information for one frame.
Parameters: - data (
kaldi.matrix.Vector
) – data point - preselect (list) – subset of mixture components
- num_gselect (int) – number of gaussians to select
Returns: Log-likelihood for the input frame and the best
num_gselect
indices that were preselected (sorted from best to worst likelihood).- data (
-
gconsts
() → Vector¶ Returns gconsts
-
get_component_mean
(gauss:int, out:VectorBase)¶ Gets component mean.
-
get_means
() → Matrix¶ Returns component means.
-
interpolate
(rho:float, source:FullGmm, flags:int=default)¶ Interpolates this model with other GMM
this <- rho * source + (1 - rho) * this
Parameters:
-
log_likelihood
(data:VectorBase) → float¶ Computes the log-likelihood for a data point
Parameters: data ( kaldi.matrix.Vector
) – data point
-
log_likelihoods
(data:VectorBase) → Vector¶ Computes the per-component log-likelihoods for a data point
Parameters: data ( kaldi.matrix.Vector
) – data point
-
log_likelihoods_preselect
(data:VectorBase, indices:list<int>) → Vector¶ Computes the per-component log-likelihoods of a subset of mixture components.
Parameters: - data (
kaldi.matrix.Vector
) – data point - indices – list of indices
- data (
-
means_invcovars
() → Matrix¶ Returns means times inverse covariances
-
merge
(target_components:int) → list<int>¶ Merges components
Parameters: target_components (int) – number of target components Returns: The order in which components were merged.
-
merge_preselect
(target_components:int, preselect_pairs:list<tuple<int, int>>) → float¶ Merges components
This version only considers merging pairs in
preselect_pairs
. :param target_components: number of target components :type target_components: int :param preselect_pairs: preselected pairs :type preselect_pairs: List[Tuple[int, int]]Returns: Delta likelihood.
-
num_gauss
() → int¶ Returns the number of mixture components.
-
perturb
(perturb_factor:float)¶ Perturbs components
Component means are perturbed with a random vector multiplied by the pertrubation factor.
Parameters: perturb_factor (float) – perturbation factor
-
read
(is:istream, binary:bool)¶ Reads gaussian mixture model from input stream.
-
remove_component
(gauss:int, renorm_weights:bool)¶ Removes single component from model.
-
remove_components
(gauss:list<int>, renorm_weights:bool)¶ Removes multiple components from model.
-
resize
(nmix:int, dim:int)¶ Resizes arrays to this dim. Does not initialize data.
-
set_inv_covars
(v:list<SpMatrix>)¶ Sets inverse covariances.
-
set_inv_covars_and_means
(invcovars:list<SpMatrix>, means:Matrix)¶ Updates both means and (inverse) covariances.
Parameters: - invcovars (list of
SpMatrix
) – List of inverse covariances - means (
kaldi.matrix.Matrix
) – matrix of means
- invcovars (list of
-
set_inv_covars_and_means_inv_covars
(invcovars:list<SpMatrix>, means_invcovars:Matrix)¶ Use this if setting both, in the class’s native format.
Parameters: - invcovars (list of
SpMatrix
) – List of inverse covariances - means_invcovars (
kaldi.matrix.Matrix
) – matrix of means and invcovars
- invcovars (list of
-
split
(target_components:int, perturb_factor:float) → list<int>¶ Splits components
Parameters: Returns: The order in which components were split.
-
weights
() → Vector¶ Returns mixture weights
-
write
(os:ostream, binary:bool)¶ Writes gaussian mixture model to output stream.
-
-
class
kaldi.gmm.
FullGmmNormal
¶ CLIF wrapper for ::kaldi::FullGmmNormal
-
copy_from_full
(fullgmm:FullGmm)¶ Calls C++ function void ::kaldi::FullGmmNormal::CopyFromFullGmm(::kaldi::FullGmm)
-
copy_to_full
(fullgmm:FullGmm, flags:int=default)¶ Calls C++ function void ::kaldi::FullGmmNormal::CopyToFullGmm(::kaldi::FullGmm *, unsigned short)
-
means_
¶ C++ ::kaldi::Matrix<double> FullGmmNormal.means_
-
new_with_other
(gmm:FullGmm) → FullGmmNormal¶ Calls C++ function std::unique_ptr<::kaldi::FullGmmNormal> ::kaldi::FullGmmNormal::FullGmmNormal(::kaldi::FullGmm)
-
rand
(feats:MatrixBase)¶ Calls C++ function void ::kaldi::FullGmmNormal::Rand(::kaldi::MatrixBase<float> *)
-
resize
(nMix:int, dim:int)¶ Calls C++ function void ::kaldi::FullGmmNormal::Resize(int, int)
-
vars_
¶ C++ ::std::vector< ::kaldi::SpMatrix<double> > FullGmmNormal.vars_
-
weights_
¶ C++ ::kaldi::Vector<double> FullGmmNormal.weights_
-
-
class
kaldi.gmm.
GmmUpdateFlags
¶ An enumeration.
-
ALL
= 15¶
-
MEANS
= 1¶
-
TRANSITIONS
= 8¶
-
VARIANCES
= 2¶
-
WEIGHTS
= 4¶
-
-
class
kaldi.gmm.
MapDiagGmmOptions
¶ CLIF wrapper for ::kaldi::MapDiagGmmOptions
-
mean_tau
¶ C++ ::kaldi::BaseFloat MapDiagGmmOptions.mean_tau
-
register
(opts:OptionsItf)¶ Calls C++ function void ::kaldi::MapDiagGmmOptions::Register(::kaldi::OptionsItf *)
-
variance_tau
¶ C++ ::kaldi::BaseFloat MapDiagGmmOptions.variance_tau
-
weight_tau
¶ C++ ::kaldi::BaseFloat MapDiagGmmOptions.weight_tau
-
-
class
kaldi.gmm.
MleDiagGmmOptions
¶ CLIF wrapper for ::kaldi::MleDiagGmmOptions
-
min_gaussian_occupancy
¶ C++ ::kaldi::BaseFloat MleDiagGmmOptions.min_gaussian_occupancy
-
min_gaussian_weight
¶ C++ ::kaldi::BaseFloat MleDiagGmmOptions.min_gaussian_weight
-
min_variance
¶ C++ double MleDiagGmmOptions.min_variance
-
register
(opts:OptionsItf)¶ Calls C++ function void ::kaldi::MleDiagGmmOptions::Register(::kaldi::OptionsItf *)
-
remove_low_count_gaussians
¶ C++ bool MleDiagGmmOptions.remove_low_count_gaussians
-
variance_floor_vector
¶ C++ ::kaldi::Vector<double> MleDiagGmmOptions.variance_floor_vector
-
-
class
kaldi.gmm.
MleFullGmmOptions
¶ CLIF wrapper for ::kaldi::MleFullGmmOptions
-
max_condition
¶ C++ ::kaldi::BaseFloat MleFullGmmOptions.max_condition
-
min_gaussian_occupancy
¶ C++ ::kaldi::BaseFloat MleFullGmmOptions.min_gaussian_occupancy
-
min_gaussian_weight
¶ C++ ::kaldi::BaseFloat MleFullGmmOptions.min_gaussian_weight
-
register
(opts:OptionsItf)¶ Calls C++ function void ::kaldi::MleFullGmmOptions::Register(::kaldi::OptionsItf *)
-
remove_low_count_gaussians
¶ C++ bool MleFullGmmOptions.remove_low_count_gaussians
-
variance_floor
¶ C++ ::kaldi::BaseFloat MleFullGmmOptions.variance_floor
-
-
class
kaldi.gmm.
SgmmUpdateFlags
¶ An enumeration.
-
ALL
= 255¶
-
COVARIANCE_MATRIX
= 8¶
-
PHONE_PROJECTIONS
= 2¶
-
PHONE_VECTORS
= 1¶
-
PHONE_WEIGHT_PROJECTIONS
= 4¶
-
SPEAKER_PROJECTIONS
= 32¶
-
SPEAKER_WEIGHT_PROJECTIONS
= 128¶
-
SUBSTATE_WEIGHTS
= 16¶
-
TRANSITIONS
= 64¶
-
-
class
kaldi.gmm.
SgmmWriteFlags
¶ An enumeration.
-
BACKGROUND_GMMS
= 8¶
-
GLOBAL_PARAMS
= 1¶
-
NORMALIZERS
= 4¶
-
STATE_PARAMS
= 2¶
-
WRITE_ALL
= 15¶
-
-
kaldi.gmm.
augment_gmm_flags
(f:int) → int¶ Calls C++ function unsigned short ::kaldi::AugmentGmmFlags(unsigned short)
-
kaldi.gmm.
get_split_targets
(state_occs:Vector, target_components:int, power:float, min_count:float) → list<int>¶ Calls C++ function void ::kaldi::GetSplitTargets(::kaldi::Vector<float>, int, float, float, ::std::vector< ::int32>*)
-
kaldi.gmm.
gmm_flags_to_string
(gmm_flags:GmmUpdateFlags) → str¶ Calls C++ function ::std::string ::kaldi::GmmFlagsToString(unsigned short)
-
kaldi.gmm.
mle_full_gmm_update
(config:MleFullGmmOptions, fullgmm_acc:AccumFullGmm, flags:int, gmm:FullGmm) -> (obj_change_out:float, count_out:float)¶ Calls C++ function void ::kaldi::MleFullGmmUpdate(::kaldi::MleFullGmmOptions, ::kaldi::AccumFullGmm, unsigned short, ::kaldi::FullGmm , float, float*)
-
kaldi.gmm.
string_to_gmm_flags
(s:str) → GmmUpdateFlags¶ Calls C++ function unsigned short ::kaldi::StringToGmmFlags(::std::string)
-
kaldi.gmm.
string_to_sgmm_update_flags
(s:str) → SgmmUpdateFlags¶ Calls C++ function unsigned short ::kaldi::StringToSgmmUpdateFlags(::std::string)
-
kaldi.gmm.
string_to_sgmm_write_flags
(s:str) → SgmmWriteFlags¶ Calls C++ function unsigned short ::kaldi::StringToSgmmWriteFlags(::std::string)
kaldi.gmm.am¶
Functions
cluster_gaussians_to_ubm |
Calls C++ function |
map_am_diag_gmm_update |
Calls C++ function |
mle_am_diag_gmm_update |
Calls C++ function |
Classes
AccumAmDiagGmm |
CLIF wrapper for ::kaldi::AccumAmDiagGmm |
AmDiagGmm |
CLIF wrapper for ::kaldi::AmDiagGmm |
DecodableAmDiagGmm |
CLIF wrapper for ::kaldi::DecodableAmDiagGmm |
DecodableAmDiagGmmScaled |
CLIF wrapper for ::kaldi::DecodableAmDiagGmmScaled |
DecodableAmDiagGmmUnmapped |
CLIF wrapper for ::kaldi::DecodableAmDiagGmmUnmapped |
UbmClusteringOptions |
CLIF wrapper for ::kaldi::UbmClusteringOptions |
-
class
kaldi.gmm.am.
AccumAmDiagGmm
¶ CLIF wrapper for ::kaldi::AccumAmDiagGmm
-
accumulate_for_gaussian
(model:AmDiagGmm, data:VectorBase, gmm_index:int, gauss_index:int, weight:float)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::AccumulateForGaussian(::kaldi::AmDiagGmm, ::kaldi::VectorBase<float>, int, int, float)
-
accumulate_for_gmm
(model:AmDiagGmm, data:VectorBase, gmm_index:int, weight:float) → float¶ Calls C++ function float ::kaldi::AccumAmDiagGmm::AccumulateForGmm(::kaldi::AmDiagGmm, ::kaldi::VectorBase<float>, int, float)
-
accumulate_for_gmm_twofeats
(model:AmDiagGmm, data1:VectorBase, data2:VectorBase, gmm_index:int, weight:float) → float¶ Calls C++ function float ::kaldi::AccumAmDiagGmm::AccumulateForGmmTwofeats(::kaldi::AmDiagGmm, ::kaldi::VectorBase<float>, ::kaldi::VectorBase<float>, int, float)
-
accumulate_from_posteriors
(model:AmDiagGmm, data:VectorBase, gmm_index:int, posteriors:VectorBase)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::AccumulateFromPosteriors(::kaldi::AmDiagGmm, ::kaldi::VectorBase<float>, int, ::kaldi::VectorBase<float>)
-
add
(scale:float, other:AccumAmDiagGmm)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::Add(float, ::kaldi::AccumAmDiagGmm)
-
dim
() → int¶ Calls C++ function int ::kaldi::AccumAmDiagGmm::Dim()
-
get_acc
(index:int) → AccumDiagGmm¶ Calls C++ function ::kaldi::AccumDiagGmm * ::kaldi::AccumAmDiagGmm::GetAccPtr(int)
-
init
(model:AmDiagGmm, flags:int)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::Init(::kaldi::AmDiagGmm, unsigned short)
-
init_with_dim
(model:AmDiagGmm, dim:int, flags:int)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::Init(::kaldi::AmDiagGmm, int, unsigned short)
-
num_accs
() → int¶ Calls C++ function int ::kaldi::AccumAmDiagGmm::NumAccs()
-
read
(is:istream, binary:bool, add:bool=default)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::Read(::std::basic_istream<char, ::std::char_traits<char> >, bool, bool)
-
scale
(scale:float)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::Scale(float)
-
set_zero
(flags:int)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::SetZero(unsigned short)
-
tot_count
() → float¶ Calls C++ function float ::kaldi::AccumAmDiagGmm::TotCount()
-
tot_log_like
() → float¶ Calls C++ function float ::kaldi::AccumAmDiagGmm::TotLogLike()
-
tot_stats_count
() → float¶ Calls C++ function float ::kaldi::AccumAmDiagGmm::TotStatsCount()
-
write
(out_stream:ostream, binary:bool)¶ Calls C++ function void ::kaldi::AccumAmDiagGmm::Write(::std::basic_ostream<char, ::std::char_traits<char> >, bool)
-
-
class
kaldi.gmm.am.
AmDiagGmm
¶ CLIF wrapper for ::kaldi::AmDiagGmm
-
add_pdf
(gmm:DiagGmm)¶ Calls C++ function void ::kaldi::AmDiagGmm::AddPdf(::kaldi::DiagGmm)
-
compute_gconsts
() → int¶ Calls C++ function int ::kaldi::AmDiagGmm::ComputeGconsts()
-
copy_from_am_diag
(other:AmDiagGmm)¶ Calls C++ function void ::kaldi::AmDiagGmm::CopyFromAmDiagGmm(::kaldi::AmDiagGmm)
-
dim
() → int¶ Calls C++ function int ::kaldi::AmDiagGmm::Dim()
-
get_gaussian_mean
(pdf_index:int, gauss:int, out:VectorBase)¶ Calls C++ function void ::kaldi::AmDiagGmm::GetGaussianMean(int, int, ::kaldi::VectorBase<float> *)
-
get_gaussian_variance
(pdf_index:int, gauss:int, out:VectorBase)¶ Calls C++ function void ::kaldi::AmDiagGmm::GetGaussianVariance(int, int, ::kaldi::VectorBase<float> *)
-
init
(proto:DiagGmm, num_pdfs:int)¶ Calls C++ function void ::kaldi::AmDiagGmm::Init(::kaldi::DiagGmm, int)
-
log_likelihood
(pdf_index:int, data:VectorBase) → float¶ Calls C++ function float ::kaldi::AmDiagGmm::LogLikelihood(int, ::kaldi::VectorBase<float>)
-
merge_by_count
(state_occs:Vector, target_components:int, power:float, min_count:float)¶ Calls C++ function void ::kaldi::AmDiagGmm::MergeByCount(::kaldi::Vector<float>, int, float, float)
-
num_gauss
() → int¶ Calls C++ function int ::kaldi::AmDiagGmm::NumGauss()
-
num_gauss_in_pdf
(pdf_index:int) → int¶ Calls C++ function int ::kaldi::AmDiagGmm::NumGaussInPdf(int)
-
num_pdfs
() → int¶ Calls C++ function int ::kaldi::AmDiagGmm::NumPdfs()
-
read
(is:istream, binary:bool)¶ Calls C++ function void ::kaldi::AmDiagGmm::Read(::std::basic_istream<char, ::std::char_traits<char> >, bool)
-
set_gaussian_mean
(pdf_index:int, gauss:int, in:VectorBase)¶ Calls C++ function void ::kaldi::AmDiagGmm::SetGaussianMean(int, int, ::kaldi::VectorBase<float>)
-
split_by_count
(state_occs:Vector, target_components:int, perturb_factor:float, power:float, min_count:float)¶ Calls C++ function void ::kaldi::AmDiagGmm::SplitByCount(::kaldi::Vector<float>, int, float, float, float)
-
split_pdf
(idx:int, target_components:int, perturb_factor:float)¶ Calls C++ function void ::kaldi::AmDiagGmm::SplitPdf(int, int, float)
-
write
(os:ostream, binary:bool)¶ Calls C++ function void ::kaldi::AmDiagGmm::Write(::std::basic_ostream<char, ::std::char_traits<char> >, bool)
-
-
class
kaldi.gmm.am.
DecodableAmDiagGmm
¶ CLIF wrapper for ::kaldi::DecodableAmDiagGmm
-
is_last_frame
(frame:int) → bool¶ Checks if given frame is the last frame.
-
log_likelihood
(frame:int, index:int) → float¶ Returns the log-likehood of the given index for the given frame.
-
num_frames_ready
() → int¶ Returns number of frames ready for decoding.
-
num_indices
() → int¶ Returns number of indices.
-
trans_model
() → TransitionModel¶ Returns the transition model.
-
-
class
kaldi.gmm.am.
DecodableAmDiagGmmScaled
¶ CLIF wrapper for ::kaldi::DecodableAmDiagGmmScaled
-
is_last_frame
(frame:int) → bool¶ Checks if given frame is the last frame.
-
log_likelihood
(frame:int, index:int) → float¶ Returns the log-likehood of the given index for the given frame.
-
num_frames_ready
() → int¶ Returns number of frames ready for decoding.
-
num_indices
() → int¶ Returns number of indices.
-
own_feats
(am:AmDiagGmm, tm:TransitionModel, scale:float, log_sum_exp_prune:float, feats:Matrix) → DecodableAmDiagGmmScaled¶ Calls C++ function std::unique_ptr<::kaldi::DecodableAmDiagGmmScaled> ::kaldi::DecodableAmDiagGmmScaled::DecodableAmDiagGmmScaled(::kaldi::AmDiagGmm, ::kaldi::TransitionModel, float, float, ::kaldi::Matrix<float> *)
-
trans_model
() → TransitionModel¶ Returns the transition model.
-
-
class
kaldi.gmm.am.
DecodableAmDiagGmmUnmapped
¶ CLIF wrapper for ::kaldi::DecodableAmDiagGmmUnmapped
-
is_last_frame
(frame:int) → bool¶ Checks if given frame is the last frame.
-
log_likelihood
(frame:int, index:int) → float¶ Returns the log-likehood of the given index for the given frame.
-
num_frames_ready
() → int¶ Returns number of frames ready for decoding.
-
num_indices
() → int¶ Returns number of indices.
-
-
class
kaldi.gmm.am.
UbmClusteringOptions
¶ CLIF wrapper for ::kaldi::UbmClusteringOptions
-
check
()¶ Calls C++ function void ::kaldi::UbmClusteringOptions::Check()
-
cluster_varfloor
¶ C++ ::kaldi::BaseFloat UbmClusteringOptions.cluster_varfloor
-
intermediate_num_gauss
¶ C++ ::int32 UbmClusteringOptions.intermediate_num_gauss
-
max_am_gauss
¶ C++ ::int32 UbmClusteringOptions.max_am_gauss
-
reduce_state_factor
¶ C++ ::kaldi::BaseFloat UbmClusteringOptions.reduce_state_factor
-
register
(opts:OptionsItf)¶ Calls C++ function void ::kaldi::UbmClusteringOptions::Register(::kaldi::OptionsItf *)
-
ubm_num_gauss
¶ C++ ::int32 UbmClusteringOptions.ubm_num_gauss
-
-
kaldi.gmm.am.
cluster_gaussians_to_ubm
(am:AmDiagGmm, state_occs:Vector, opts:UbmClusteringOptions, ubm_out:DiagGmm)¶ Calls C++ function void ::kaldi::ClusterGaussiansToUbm(::kaldi::AmDiagGmm, ::kaldi::Vector<float>, ::kaldi::UbmClusteringOptions, ::kaldi::DiagGmm *)
-
kaldi.gmm.am.
map_am_diag_gmm_update
(config:MapDiagGmmOptions, diag_gmm_acc:AccumAmDiagGmm, flags:int, am_gmm:AmDiagGmm) -> (obj_change_out:float, count_out:float)¶ Calls C++ function void ::kaldi::MapAmDiagGmmUpdate(::kaldi::MapDiagGmmOptions, ::kaldi::AccumAmDiagGmm, unsigned short, ::kaldi::AmDiagGmm , float, float*)
-
kaldi.gmm.am.
mle_am_diag_gmm_update
(config:MleDiagGmmOptions, diag_gmm_acc:AccumAmDiagGmm, flags:int, am_gmm:AmDiagGmm) -> (obj_change_out:float, count_out:float)¶ Calls C++ function void ::kaldi::MleAmDiagGmmUpdate(::kaldi::MleDiagGmmOptions, ::kaldi::AccumAmDiagGmm, unsigned short, ::kaldi::AmDiagGmm , float, float*)