Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.gmm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.bio.gmm
Commits
772c1314
Commit
772c1314
authored
3 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
remove feature checks
parent
96d65477
Branches
Branches containing commit
No related tags found
1 merge request
!34
GMM.transform no longer returns dask arrays
Pipeline
#60028
passed
3 years ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/gmm/algorithm/GMM.py
+0
-20
0 additions, 20 deletions
bob/bio/gmm/algorithm/GMM.py
with
0 additions
and
20 deletions
bob/bio/gmm/algorithm/GMM.py
+
0
−
20
View file @
772c1314
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment