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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
Lucas Miranda
deepOF
Commits
3d50dfbe
Commit
3d50dfbe
authored
Apr 26, 2021
by
lucas_miranda
Browse files
Added a MirroredStrategy to train models on multiple GPUs if they are available
parent
0016131f
Changes
1
Show whitespace changes
Inline
Side-by-side
deepof/models.py
View file @
3d50dfbe
...
...
@@ -262,6 +262,7 @@ class SEQ_2_SEQ_GMVAE:
rule_based_features
:
int
=
6
,
reg_cat_clusters
:
bool
=
False
,
reg_cluster_variance
:
bool
=
False
,
strategy
=
tf
.
distribute
.
MirroredStrategy
()
):
self
.
hparams
=
self
.
get_hparams
(
architecture_hparams
)
self
.
batch_size
=
batch_size
...
...
@@ -296,6 +297,7 @@ class SEQ_2_SEQ_GMVAE:
self
.
prior
=
"standard_normal"
self
.
reg_cat_clusters
=
reg_cat_clusters
self
.
reg_cluster_variance
=
reg_cluster_variance
self
.
strategy
=
strategy
assert
(
"ELBO"
in
self
.
loss
or
"MMD"
in
self
.
loss
...
...
@@ -576,6 +578,8 @@ class SEQ_2_SEQ_GMVAE:
Model_RC1
,
)
=
self
.
get_layers
(
input_shape
)
with
self
.
strategy
.
scope
():
# Define and instantiate encoder
x
=
Input
(
shape
=
input_shape
[
1
:])
encoder
=
Model_E0
(
x
)
...
...
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