Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
70fc197b
Unverified
Commit
70fc197b
authored
Nov 06, 2020
by
Vincent QB
Committed by
GitHub
Nov 06, 2020
Browse files
remove print-freq option and compute validation loss at each epoch. (#997)
parent
076052f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
34 deletions
+25
-34
examples/pipeline_wav2letter/main.py
examples/pipeline_wav2letter/main.py
+25
-34
No files found.
examples/pipeline_wav2letter/main.py
View file @
70fc197b
...
@@ -83,13 +83,6 @@ def parse_args():
...
@@ -83,13 +83,6 @@ def parse_args():
parser
.
add_argument
(
parser
.
add_argument
(
"--start-epoch"
,
default
=
0
,
type
=
int
,
metavar
=
"N"
,
help
=
"manual epoch number"
"--start-epoch"
,
default
=
0
,
type
=
int
,
metavar
=
"N"
,
help
=
"manual epoch number"
)
)
parser
.
add_argument
(
"--print-freq"
,
default
=
10
,
type
=
int
,
metavar
=
"N"
,
help
=
"print frequency in epochs"
,
)
parser
.
add_argument
(
parser
.
add_argument
(
"--reduce-lr-valid"
,
"--reduce-lr-valid"
,
action
=
"store_true"
,
action
=
"store_true"
,
...
@@ -615,8 +608,6 @@ def main(rank, args):
...
@@ -615,8 +608,6 @@ def main(rank, args):
not
args
.
reduce_lr_valid
,
not
args
.
reduce_lr_valid
,
)
)
if
not
(
epoch
+
1
)
%
args
.
print_freq
or
epoch
==
args
.
epochs
-
1
:
loss
=
evaluate
(
loss
=
evaluate
(
model
,
model
,
criterion
,
criterion
,
...
@@ -628,6 +619,9 @@ def main(rank, args):
...
@@ -628,6 +619,9 @@ def main(rank, args):
not_main_rank
,
not_main_rank
,
)
)
if
args
.
reduce_lr_valid
and
isinstance
(
scheduler
,
ReduceLROnPlateau
):
scheduler
.
step
(
loss
)
is_best
=
loss
<
best_loss
is_best
=
loss
<
best_loss
best_loss
=
min
(
loss
,
best_loss
)
best_loss
=
min
(
loss
,
best_loss
)
save_checkpoint
(
save_checkpoint
(
...
@@ -643,9 +637,6 @@ def main(rank, args):
...
@@ -643,9 +637,6 @@ def main(rank, args):
not_main_rank
,
not_main_rank
,
)
)
if
args
.
reduce_lr_valid
and
isinstance
(
scheduler
,
ReduceLROnPlateau
):
scheduler
.
step
(
loss
)
logging
.
info
(
"End time: %s"
,
datetime
.
now
())
logging
.
info
(
"End time: %s"
,
datetime
.
now
())
if
args
.
distributed
:
if
args
.
distributed
:
...
...
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