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

remove feature checks

parent 96d65477
Branches
No related tags found
1 merge request!34GMM.transform no longer returns dask arrays
Pipeline #60028 passed
......@@ -141,22 +141,6 @@ class GMM(BioAlgorithm, BaseEstimator):
self.ubm = None
def _check_feature(self, feature):
"""Checks that the features are appropriate"""
if (
not isinstance(feature, np.ndarray)
or feature.ndim != 2
or feature.dtype != np.float64
):
raise ValueError(
f"The given feature is not appropriate: \n{feature}"
)
if self.ubm is not None and feature.shape[1] != self.ubm.shape[1]:
raise ValueError(
"The given feature is expected to have %d elements, but it has %d"
% (self.ubm.shape[1], feature.shape[1])
)
def save_model(self, ubm_file):
"""Saves the projector (UBM) to file."""
# Saves the UBM to file
......@@ -182,7 +166,6 @@ class GMM(BioAlgorithm, BaseEstimator):
This is applied to the probes before scoring.
"""
self._check_feature(array)
logger.debug("Projecting %d feature vectors", array.shape[0])
# Accumulates statistics
gmm_stats = self.ubm.transform(array)
......@@ -196,9 +179,6 @@ class GMM(BioAlgorithm, BaseEstimator):
Returns a GMMMachine tuned from the UBM with MAP on a biometric reference data.
"""
for feature in data:
self._check_feature(feature)
# if input is a list (or SampleBatch) of 2 dimensional arrays, stack them
if data[0].ndim == 2:
data = np.vstack(data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment