Skip to content
Snippets Groups Projects
Commit cb0161fe authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

create the UBM at init

parent 772c1314
No related branches found
No related tags found
1 merge request!34GMM.transform no longer returns dask arrays
Pipeline #60494 failed
......@@ -139,7 +139,25 @@ class GMM(BioAlgorithm, BaseEstimator):
self.scoring_function = scoring_function
self.ubm = None
self.ubm = GMMMachine(
n_gaussians=self.number_of_gaussians,
trainer="ml",
max_fitting_steps=self.ubm_training_iterations,
convergence_threshold=self.training_threshold,
update_means=self.update_means,
update_variances=self.update_variances,
update_weights=self.update_weights,
mean_var_update_threshold=self.variance_threshold,
k_means_trainer=KMeansMachine(
self.number_of_gaussians,
convergence_threshold=self.training_threshold,
max_iter=self.kmeans_training_iterations,
init_method="k-means||",
init_max_iter=self.kmeans_init_iterations,
random_state=self.init_seed,
oversampling_factor=self.kmeans_oversampling_factor,
),
)
def save_model(self, ubm_file):
"""Saves the projector (UBM) to file."""
......@@ -277,26 +295,6 @@ class GMM(BioAlgorithm, BaseEstimator):
f"Creating UBM machine with {self.number_of_gaussians} gaussians and {len(array)} samples"
)
self.ubm = GMMMachine(
n_gaussians=self.number_of_gaussians,
trainer="ml",
max_fitting_steps=self.ubm_training_iterations,
convergence_threshold=self.training_threshold,
update_means=self.update_means,
update_variances=self.update_variances,
update_weights=self.update_weights,
mean_var_update_threshold=self.variance_threshold,
k_means_trainer=KMeansMachine(
self.number_of_gaussians,
convergence_threshold=self.training_threshold,
max_iter=self.kmeans_training_iterations,
init_method="k-means||",
init_max_iter=self.kmeans_init_iterations,
random_state=self.init_seed,
oversampling_factor=self.kmeans_oversampling_factor,
),
)
# Train the GMM
logger.info("Training UBM GMM")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment