Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.em
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.learn.em
Commits
26bebe08
Commit
26bebe08
authored
3 years ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
[refactor] Rename k_means as kmeans
parent
63c831ff
No related branches found
No related tags found
1 merge request
!49
Fix np memory issues and rename k_means to kmeans
Pipeline
#59378
failed
3 years ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bob/learn/em/__init__.py
+1
-1
1 addition, 1 deletion
bob/learn/em/__init__.py
bob/learn/em/gmm.py
+1
-1
1 addition, 1 deletion
bob/learn/em/gmm.py
bob/learn/em/kmeans.py
+0
-0
0 additions, 0 deletions
bob/learn/em/kmeans.py
bob/learn/em/test/test_kmeans.py
+2
-2
2 additions, 2 deletions
bob/learn/em/test/test_kmeans.py
with
4 additions
and
4 deletions
bob/learn/em/__init__.py
+
1
−
1
View file @
26bebe08
import
bob.extension
import
bob.extension
from
.gmm
import
GMMMachine
,
GMMStats
from
.gmm
import
GMMMachine
,
GMMStats
from
.k
_
means
import
KMeansMachine
from
.kmeans
import
KMeansMachine
from
.linear_scoring
import
linear_scoring
# noqa: F401
from
.linear_scoring
import
linear_scoring
# noqa: F401
from
.wccn
import
WCCN
from
.wccn
import
WCCN
from
.whitening
import
Whitening
from
.whitening
import
Whitening
...
...
This diff is collapsed.
Click to expand it.
bob/learn/em/gmm.py
+
1
−
1
View file @
26bebe08
...
@@ -18,7 +18,7 @@ import numpy as np
...
@@ -18,7 +18,7 @@ import numpy as np
from
h5py
import
File
as
HDF5File
from
h5py
import
File
as
HDF5File
from
sklearn.base
import
BaseEstimator
from
sklearn.base
import
BaseEstimator
from
.k
_
means
import
(
from
.kmeans
import
(
KMeansMachine
,
KMeansMachine
,
array_to_delayed_list
,
array_to_delayed_list
,
check_and_persist_dask_input
,
check_and_persist_dask_input
,
...
...
This diff is collapsed.
Click to expand it.
bob/learn/em/k
_
means.py
→
bob/learn/em/kmeans.py
+
0
−
0
View file @
26bebe08
File moved
This diff is collapsed.
Click to expand it.
bob/learn/em/test/test_kmeans.py
+
2
−
2
View file @
26bebe08
...
@@ -16,7 +16,7 @@ import dask.array as da
...
@@ -16,7 +16,7 @@ import dask.array as da
import
numpy
as
np
import
numpy
as
np
import
scipy.spatial.distance
import
scipy.spatial.distance
from
bob.learn.em
import
KMeansMachine
,
k
_
means
from
bob.learn.em
import
KMeansMachine
,
kmeans
def
to_numpy
(
*
args
):
def
to_numpy
(
*
args
):
...
@@ -187,6 +187,6 @@ def test_get_centroids_distance():
...
@@ -187,6 +187,6 @@ def test_get_centroids_distance():
oracle
=
scipy
.
spatial
.
distance
.
cdist
(
means
,
data
,
metric
=
"
sqeuclidean
"
)
oracle
=
scipy
.
spatial
.
distance
.
cdist
(
means
,
data
,
metric
=
"
sqeuclidean
"
)
for
transform
in
(
to_numpy
,):
for
transform
in
(
to_numpy
,):
data
,
means
=
transform
(
data
,
means
)
data
,
means
=
transform
(
data
,
means
)
dist
=
k
_
means
.
get_centroids_distance
(
data
,
means
)
dist
=
kmeans
.
get_centroids_distance
(
data
,
means
)
np
.
testing
.
assert_allclose
(
dist
,
oracle
)
np
.
testing
.
assert_allclose
(
dist
,
oracle
)
assert
type
(
data
)
is
type
(
dist
),
(
type
(
data
),
type
(
dist
))
assert
type
(
data
)
is
type
(
dist
),
(
type
(
data
),
type
(
dist
))
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