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
09bd026d
Commit
09bd026d
authored
Jul 28, 2020
by
lucas_miranda
Browse files
Enhanced performance with tf.function decorators
parent
5d154b87
Changes
2
Hide whitespace changes
Inline
Side-by-side
source/model_utils.py
View file @
09bd026d
...
...
@@ -166,6 +166,15 @@ class KLDivergenceLayer(tfpl.KLDivergenceAddLoss):
self
.
is_placeholder
=
True
super
(
KLDivergenceLayer
,
self
).
__init__
(
*
args
,
**
kwargs
)
def
get_config
(
self
):
config
=
super
().
get_config
().
copy
()
config
.
update
(
{
"is_placeholder"
:
self
.
is_placeholder
,
}
)
return
config
def
call
(
self
,
distribution_a
):
kl_batch
=
self
.
_regularizer
(
distribution_a
)
self
.
add_loss
(
kl_batch
,
inputs
=
[
distribution_a
])
...
...
source/models.py
View file @
09bd026d
...
...
@@ -171,7 +171,7 @@ class SEQ_2_SEQ_GMVAE:
number_of_components
=
1
,
predictor
=
True
,
overlap_loss
=
False
,
entropy_reg_weight
=
1
.0
,
entropy_reg_weight
=
0
.0
,
):
self
.
input_shape
=
input_shape
self
.
batch_size
=
batch_size
...
...
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