Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Miranda
deepOF
Commits
3c773f9f
Commit
3c773f9f
authored
Mar 12, 2021
by
lucas_miranda
Browse files
Prototyped KNN_purity callback
parent
9f0a9f31
Changes
3
Hide whitespace changes
Inline
Side-by-side
deepof/model_utils.py
View file @
3c773f9f
...
...
@@ -15,6 +15,7 @@ from tensorflow.keras import backend as K
from
tensorflow.keras.constraints
import
Constraint
from
tensorflow.keras.layers
import
Layer
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
tensorflow
as
tf
import
tensorflow_probability
as
tfp
...
...
deepof/train_model.py
View file @
3c773f9f
...
...
@@ -394,6 +394,7 @@ else:
run_ID
,
tensorboard_callback
,
knn
,
onecycle
=
get_callbacks
(
X_train
=
X_train
,
X_val
=
(
X_val
if
X_val
.
shape
!=
(
0
,)
else
None
),
batch_size
=
batch_size
,
cp
=
False
,
variational
=
variational
,
...
...
deepof/train_utils.py
View file @
3c773f9f
...
...
@@ -71,6 +71,7 @@ def get_callbacks(
phenotype_class
:
float
,
predictor
:
float
,
loss
:
str
,
X_val
:
np
.
array
=
None
,
cp
:
bool
=
False
,
reg_cat_clusters
:
bool
=
False
,
reg_cluster_variance
:
bool
=
False
,
...
...
@@ -114,6 +115,7 @@ def get_callbacks(
knn
=
deepof
.
model_utils
.
knn_cluster_purity
(
k
=
knn_neighbors
,
samples
=
knn_samples
,
validation_data
=
X_val
,
)
onecycle
=
deepof
.
model_utils
.
one_cycle_scheduler
(
...
...
@@ -283,6 +285,7 @@ def autoencoder_fitting(
# Load callbacks
run_ID
,
*
cbacks
=
get_callbacks
(
X_train
=
X_train
,
X_val
=
(
X_val
if
X_val
.
shape
!=
(
0
,)
else
None
),
batch_size
=
batch_size
,
cp
=
save_checkpoints
,
variational
=
variational
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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