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
2481cbb8
Commit
2481cbb8
authored
Jul 20, 2020
by
lucas_miranda
Browse files
Early stopping now uses the overall loss function instead of the intercomponent overlap
parent
ae848b4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/model_utils.py
View file @
2481cbb8
...
...
@@ -275,7 +275,7 @@ class Entropy_regulariser(Layer):
Identity layer that adds cluster weight entropy to the loss function
"""
def
__init__
(
self
,
weight
=
1
.
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
weight
=
0
.
,
*
args
,
**
kwargs
):
self
.
weight
=
weight
super
(
Entropy_regulariser
,
self
).
__init__
(
*
args
,
**
kwargs
)
...
...
@@ -290,7 +290,7 @@ class Entropy_regulariser(Layer):
)
# Adds metric that monitors dead neurons in the latent space
self
.
add_metric
(
-
entropy
,
aggregation
=
"mean"
,
name
=
"weight_entropy"
)
self
.
add_metric
(
entropy
,
aggregation
=
"mean"
,
name
=
"
-
weight_entropy"
)
self
.
add_loss
(
self
.
weight
*
K
.
sum
(
entropy
),
inputs
=
[
z
])
...
...
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