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
Richard Vogl
piano_transcription
Commits
672f46f3
Commit
672f46f3
authored
Jun 15, 2018
by
Richard Vogl
Browse files
model changes
parent
8ef23822
Changes
1
Hide whitespace changes
Inline
Side-by-side
piano_transcription/train_model.py
View file @
672f46f3
...
...
@@ -94,8 +94,7 @@ def run(model, model_name, learn_rate, batch_size, split, k_samples):
train_batches
=
0
start_time
=
time
.
time
()
for
batch_nr
,
f_ins
in
enumerate
(
train_batch_iterator
):
cur_loss
=
train_fn
(
*
f_ins
)
print
(
'cur loss shape = %d'
%
len
(
cur_loss
))
cur_loss
=
train_fn
(
*
f_ins
)[
0
]
train_loss_sum
+=
cur_loss
[
0
]
train_batches
+=
1
...
...
@@ -108,7 +107,7 @@ def run(model, model_name, learn_rate, batch_size, split, k_samples):
valid_batches
=
0
valid_start_time
=
time
.
time
()
for
batch_nr
,
f_ins
in
enumerate
(
valid_batch_iterator
):
cur_loss
=
eval_fn
(
*
f_ins
)
cur_loss
=
eval_fn
(
*
f_ins
)
[
0
]
valid_loss_sum
+=
cur_loss
valid_batches
+=
1
valid_loss
[
epoch
]
=
valid_loss_sum
/
valid_batches
...
...
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