Skip to content
GitLab
Menu
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
b886fa86
Commit
b886fa86
authored
Oct 07, 2020
by
lucas_miranda
Browse files
Refactored hyperparameter tuning in train_utils.py
parent
f5a37af1
Pipeline
#83717
failed with stage
in 25 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
deepof/train_utils.py
View file @
b886fa86
...
...
@@ -13,7 +13,6 @@ from kerastuner import BayesianOptimization
from
typing
import
Tuple
,
Union
,
Any
,
List
import
deepof.hypermodels
import
deepof.model_utils
import
keras
import
numpy
as
np
import
os
import
pickle
...
...
@@ -84,7 +83,7 @@ def get_callbacks(
)
log_dir
=
os
.
path
.
abspath
(
"logs/fit/{}"
.
format
(
run_ID
))
tensorboard_callback
=
keras
.
callbacks
.
TensorBoard
(
tensorboard_callback
=
tf
.
keras
.
callbacks
.
TensorBoard
(
log_dir
=
log_dir
,
histogram_freq
=
1
,
profile_batch
=
2
,
)
...
...
tests/test_train_utils.py
View file @
b886fa86
...
...
@@ -14,7 +14,6 @@ from hypothesis import strategies as st
from
hypothesis.extra.numpy
import
arrays
import
deepof.model_utils
import
deepof.train_utils
import
keras
import
os
import
tensorflow
as
tf
...
...
@@ -64,7 +63,7 @@ def test_get_callbacks(
X_train
,
batch_size
,
variational
,
predictor
,
k
,
loss
,
kl_wu
,
mmd_wu
,
)
assert
type
(
runID
)
==
str
assert
type
(
tbc
)
==
keras
.
callbacks
.
tensorboard_v2
.
TensorBoard
assert
type
(
tbc
)
==
tf
.
keras
.
callbacks
.
TensorBoard
assert
type
(
cpc
)
==
tf
.
python
.
keras
.
callbacks
.
ModelCheckpoint
assert
type
(
cycle1c
)
==
deepof
.
model_utils
.
one_cycle_scheduler
...
...
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