Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Miranda
deepOF
Commits
a07edada
Commit
a07edada
authored
Mar 12, 2021
by
lucas_miranda
Browse files
Implemented KNN_purity callback
parent
dd62bd2e
Pipeline
#95529
failed with stages
in 26 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
deepof/model_utils.py
View file @
a07edada
...
...
@@ -257,6 +257,7 @@ class knn_cluster_purity(tf.keras.callbacks.Callback):
knn
=
NearestNeighbors
().
fit
(
encoding
)
# Iterate over samples and compute purity over k neighbours
self
.
samples
=
np
.
min
([
self
.
samples
,
encoding
.
shape
[
0
]])
random_idxs
=
np
.
random
.
choice
(
range
(
encoding
.
shape
[
0
]),
self
.
samples
,
replace
=
False
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment