Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
0
02456-deep-learning-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
niejep
02456-deep-learning-project
Commits
10bd7f6b
Commit
10bd7f6b
authored
Jan 3, 2018
by
Niels Jeppesen
Browse files
Options
Downloads
Patches
Plain Diff
Saving all weights.
parent
450670a4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
autoencoder.py
+5
-2
5 additions, 2 deletions
autoencoder.py
with
5 additions
and
2 deletions
autoencoder.py
+
5
−
2
View file @
10bd7f6b
...
...
@@ -42,7 +42,7 @@ class ExtendedModel(Model):
self
.
checkpoint_callback
=
ModelCheckpoint
(
os
.
path
.
join
(
checkpoint_dir
,
timestamp
+
'
.weights.{epoch:05d}-{val_loss:.2f}.hdf5
'
),
monitor
=
'
val_loss
'
,
verbose
=
0
,
save_best_only
=
Tru
e
,
save_best_only
=
Fals
e
,
save_weights_only
=
False
,
mode
=
'
auto
'
,
period
=
checkpoint
)
...
...
@@ -252,6 +252,9 @@ class VariationalAutoencoder(ExtendedModel):
class
SemiSupervisedClassifier
(
ExtendedModel
):
"""
A semi-supervised classifier using a variational autoencoder.
Based on tutorial by Lars Maaløe.
https://github.com/DeepLearningDTU/variational-autoencoders-summerschool-2016/blob/master/lab4/lab4_VAESSL.ipynb
"""
def
__init__
(
self
,
input_shape
,
encoder_layers
,
decoder_layers
,
classifier_layers
,
num_classes
,
factor_labels
,
model_name
=
'
SSClassifier
'
,
optimizer
=
'
adam
'
,
log_dir
=
'
tf_logs
'
,
checkpoint_dir
=
'
models
'
,
compile_model
=
True
,
z_dim
=
2
):
...
...
@@ -420,7 +423,7 @@ class SemiSupervisedClassifier(ExtendedModel):
tensorboard
=
True
,
log_dir
=
log_dir
,
name
=
model_name
,
checkpoint
=
5
checkpoint
=
10
)
# def mean(f):
...
...
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