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
04541053
Commit
04541053
authored
Sep 17, 2020
by
lucas_miranda
Browse files
Reformatted files
parent
1338ba03
Changes
3
Hide whitespace changes
Inline
Side-by-side
deepof/hypermodels.py
View file @
04541053
...
...
@@ -92,7 +92,7 @@ class SEQ_2_SEQ_AE(HyperModel):
ENCODING
,
activation
=
"relu"
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
activity_regularizer
=
U
ncorrelated
F
eatures
C
onstraint
(
3
,
weightage
=
1.0
),
activity_regularizer
=
u
ncorrelated
_f
eatures
_c
onstraint
(
3
,
weightage
=
1.0
),
kernel_initializer
=
Orthogonal
(),
)
...
...
@@ -340,7 +340,7 @@ class SEQ_2_SEQ_GMVAE(HyperModel):
for
k
in
range
(
self
.
number_of_components
)
],
),
activity_regularizer
=
U
ncorrelated
F
eatures
C
onstraint
(
3
,
weightage
=
1.0
),
activity_regularizer
=
u
ncorrelated
_f
eatures
_c
onstraint
(
3
,
weightage
=
1.0
),
)([
z_cat
,
z_gauss
])
if
"ELBO"
in
self
.
loss
:
...
...
deepof/model_utils.py
View file @
04541053
...
...
@@ -172,7 +172,14 @@ class one_cycle_scheduler(tf.keras.callbacks.Callback):
K
.
set_value
(
self
.
model
.
optimizer
.
lr
,
rate
)
class
UncorrelatedFeaturesConstraint
(
Constraint
):
class
uncorrelated_features_constraint
(
Constraint
):
"""
Tensorflow Constraint subclass that forces a layer to have uncorrelated features.
Useful, among others, for auto encoder bottleneck layers
"""
def
__init__
(
self
,
encoding_dim
,
weightage
=
1.0
):
self
.
encoding_dim
=
encoding_dim
self
.
weightage
=
weightage
...
...
deepof/models.py
View file @
04541053
...
...
@@ -92,7 +92,7 @@ class SEQ_2_SEQ_AE:
self
.
ENCODING
,
activation
=
"elu"
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
activity_regularizer
=
U
ncorrelated
F
eatures
C
onstraint
(
2
,
weightage
=
1.0
),
activity_regularizer
=
u
ncorrelated
_f
eatures
_c
onstraint
(
2
,
weightage
=
1.0
),
kernel_initializer
=
Orthogonal
(),
)
...
...
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