Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepOF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lucas Miranda
deepOF
Commits
3243a42f
Commit
3243a42f
authored
4 years ago
by
Lucas Miranda
Browse files
Options
Downloads
Patches
Plain Diff
Updated default GMVAE models
parent
00cff2d9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#87793
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
deepof/hypermodels.py
+4
-2
4 additions, 2 deletions
deepof/hypermodels.py
deepof/model_utils.py
+1
-1
1 addition, 1 deletion
deepof/model_utils.py
deepof/models.py
+24
-18
24 additions, 18 deletions
deepof/models.py
with
29 additions
and
21 deletions
deepof/hypermodels.py
+
4
−
2
View file @
3243a42f
...
...
@@ -122,8 +122,10 @@ class SEQ_2_SEQ_GMVAE(HyperModel):
default
=
0.0
,
sampling
=
"
linear
"
,
)
encoding
=
16
#hp.Int("encoding", min_value=20, max_value=30, step=5, default=25, )
k
=
5
# hp.Int(
encoding
=
(
16
# hp.Int("encoding", min_value=20, max_value=30, step=5, default=25, )
)
k
=
5
# hp.Int(
# "n_components",
# min_value=self.number_of_components - 5,
# max_value=self.number_of_components + 5,
...
...
This diff is collapsed.
Click to expand it.
deepof/model_utils.py
+
1
−
1
View file @
3243a42f
...
...
@@ -433,7 +433,7 @@ class Gaussian_mixture_overlap(Layer):
dists
=
[]
for
k
in
range
(
self
.
n_components
):
locs
=
(
target
[...,
:
self
.
lat_dims
,
k
],)
scales
=
tf
.
keras
.
activations
.
softplus
(
target
[...,
self
.
lat_dims
:,
k
])
scales
=
tf
.
keras
.
activations
.
softplus
(
target
[...,
self
.
lat_dims
:,
k
])
dists
.
append
(
tfd
.
BatchReshape
(
tfd
.
MultivariateNormalDiag
(
locs
,
scales
),
[
-
1
])
...
...
This diff is collapsed.
Click to expand it.
deepof/models.py
+
24
−
18
View file @
3243a42f
...
...
@@ -133,7 +133,7 @@ class SEQ_2_SEQ_AE:
activation
=
"
tanh
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
True
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
#
kernel_constraint=UnitNorm(axis=1),
)
)
Model_D5
=
Bidirectional
(
...
...
@@ -142,7 +142,7 @@ class SEQ_2_SEQ_AE:
activation
=
"
sigmoid
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
True
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
#
kernel_constraint=UnitNorm(axis=1),
)
)
...
...
@@ -231,6 +231,7 @@ class SEQ_2_SEQ_GMVAE:
architecture_hparams
:
dict
=
{},
batch_size
:
int
=
256
,
compile_model
:
bool
=
True
,
dense_activation
:
str
=
"
elu
"
,
entropy_reg_weight
:
float
=
0.0
,
huber_delta
:
float
=
1.0
,
initialiser_iters
:
int
=
int
(
1e4
),
...
...
@@ -245,6 +246,7 @@ class SEQ_2_SEQ_GMVAE:
self
.
hparams
=
self
.
get_hparams
(
architecture_hparams
)
self
.
batch_size
=
batch_size
self
.
CONV_filters
=
self
.
hparams
[
"
units_conv
"
]
self
.
dense_activation
=
dense_activation
self
.
LSTM_units_1
=
self
.
hparams
[
"
units_lstm
"
]
self
.
LSTM_units_2
=
int
(
self
.
hparams
[
"
units_lstm
"
]
/
2
)
self
.
DENSE_1
=
int
(
self
.
hparams
[
"
units_lstm
"
]
/
2
)
...
...
@@ -332,7 +334,7 @@ class SEQ_2_SEQ_GMVAE:
kernel_size
=
5
,
strides
=
1
,
padding
=
"
causal
"
,
activation
=
"
el
u
"
,
activation
=
s
el
f
.
dense_activation
,
kernel_initializer
=
he_uniform
(),
use_bias
=
True
,
)
...
...
@@ -342,7 +344,7 @@ class SEQ_2_SEQ_GMVAE:
activation
=
"
tanh
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
True
,
kernel_constraint
=
UnitNorm
(
axis
=
0
),
#
kernel_constraint=UnitNorm(axis=0),
use_bias
=
True
,
)
)
...
...
@@ -352,21 +354,21 @@ class SEQ_2_SEQ_GMVAE:
activation
=
"
tanh
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
False
,
kernel_constraint
=
UnitNorm
(
axis
=
0
),
#
kernel_constraint=UnitNorm(axis=0),
use_bias
=
True
,
)
)
Model_E3
=
Dense
(
self
.
DENSE_1
,
activation
=
"
el
u
"
,
kernel_constraint
=
UnitNorm
(
axis
=
0
),
activation
=
s
el
f
.
dense_activation
,
#
kernel_constraint=UnitNorm(axis=0),
kernel_initializer
=
he_uniform
(),
use_bias
=
True
,
)
Model_E4
=
Dense
(
self
.
DENSE_2
,
activation
=
"
el
u
"
,
kernel_constraint
=
UnitNorm
(
axis
=
0
),
activation
=
s
el
f
.
dense_activation
,
#
kernel_constraint=UnitNorm(axis=0),
kernel_initializer
=
he_uniform
(),
use_bias
=
True
,
)
...
...
@@ -378,13 +380,13 @@ class SEQ_2_SEQ_GMVAE:
Model_B4
=
BatchNormalization
()
Model_D1
=
Dense
(
self
.
DENSE_2
,
activation
=
"
el
u
"
,
activation
=
s
el
f
.
dense_activation
,
kernel_initializer
=
he_uniform
(),
use_bias
=
True
,
)
Model_D2
=
Dense
(
self
.
DENSE_1
,
activation
=
"
el
u
"
,
activation
=
s
el
f
.
dense_activation
,
kernel_initializer
=
he_uniform
(),
use_bias
=
True
,
)
...
...
@@ -395,7 +397,7 @@ class SEQ_2_SEQ_GMVAE:
activation
=
"
tanh
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
True
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
#
kernel_constraint=UnitNorm(axis=1),
use_bias
=
True
,
)
)
...
...
@@ -405,7 +407,7 @@ class SEQ_2_SEQ_GMVAE:
activation
=
"
sigmoid
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
True
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
#
kernel_constraint=UnitNorm(axis=1),
use_bias
=
True
,
)
)
...
...
@@ -413,7 +415,7 @@ class SEQ_2_SEQ_GMVAE:
# Predictor layers
Model_P1
=
Dense
(
self
.
DENSE_1
,
activation
=
"
el
u
"
,
activation
=
s
el
f
.
dense_activation
,
kernel_initializer
=
he_uniform
(),
use_bias
=
True
,
)
...
...
@@ -423,7 +425,7 @@ class SEQ_2_SEQ_GMVAE:
activation
=
"
tanh
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
True
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
#
kernel_constraint=UnitNorm(axis=1),
use_bias
=
True
,
)
)
...
...
@@ -433,14 +435,16 @@ class SEQ_2_SEQ_GMVAE:
activation
=
"
tanh
"
,
recurrent_activation
=
"
sigmoid
"
,
return_sequences
=
True
,
kernel_constraint
=
UnitNorm
(
axis
=
1
),
#
kernel_constraint=UnitNorm(axis=1),
use_bias
=
True
,
)
)
# Phenotype classification layers
Model_PC1
=
Dense
(
self
.
number_of_components
,
activation
=
"
elu
"
,
kernel_initializer
=
he_uniform
()
self
.
number_of_components
,
activation
=
self
.
dense_activation
,
kernel_initializer
=
he_uniform
(),
)
return
(
...
...
@@ -596,7 +600,9 @@ class SEQ_2_SEQ_GMVAE:
if
self
.
predictor
>
0
:
# Define and instantiate predictor
predictor
=
Dense
(
self
.
DENSE_2
,
activation
=
"
elu
"
,
kernel_initializer
=
he_uniform
()
self
.
DENSE_2
,
activation
=
self
.
dense_activation
,
kernel_initializer
=
he_uniform
(),
)(
z
)
predictor
=
BatchNormalization
()(
predictor
)
predictor
=
Model_P1
(
predictor
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment