Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
5899f1b5
Commit
5899f1b5
authored
4 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[engine.trainer] Improve docs; Use f-strings where possible
parent
39ed1c24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
Streamlining
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/ip/binseg/engine/trainer.py
+3
-4
3 additions, 4 deletions
bob/ip/binseg/engine/trainer.py
with
3 additions
and
4 deletions
bob/ip/binseg/engine/trainer.py
+
3
−
4
View file @
5899f1b5
...
@@ -13,7 +13,6 @@ from bob.ip.binseg.utils.metric import SmoothedValue
...
@@ -13,7 +13,6 @@ from bob.ip.binseg.utils.metric import SmoothedValue
from
bob.ip.binseg.utils.plot
import
loss_curve
from
bob.ip.binseg.utils.plot
import
loss_curve
import
logging
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -63,7 +62,7 @@ def do_train(
...
@@ -63,7 +62,7 @@ def do_train(
device to use ``
'
cpu
'
`` or ``cuda:0``
device to use ``
'
cpu
'
`` or ``cuda:0``
arguments : dict
arguments : dict
start
e
nd end epochs
start
a
nd end epochs
output_folder : str
output_folder : str
output path
output path
...
@@ -133,10 +132,10 @@ def do_train(
...
@@ -133,10 +132,10 @@ def do_train(
optimizer
.
step
()
optimizer
.
step
()
losses
.
update
(
loss
)
losses
.
update
(
loss
)
logger
.
debug
(
"
batch loss: {
}
"
.
format
(
loss
.
item
()
)
)
logger
.
debug
(
f
"
batch loss:
{
loss
.
item
()
}
"
)
if
checkpoint_period
and
(
epoch
%
checkpoint_period
==
0
):
if
checkpoint_period
and
(
epoch
%
checkpoint_period
==
0
):
checkpointer
.
save
(
"
model_{:03d}
"
.
format
(
epoch
)
,
**
arguments
)
checkpointer
.
save
(
f
"
model_
{
epoch
:
03
d
}
"
,
**
arguments
)
if
epoch
>=
max_epoch
:
if
epoch
>=
max_epoch
:
checkpointer
.
save
(
"
model_final
"
,
**
arguments
)
checkpointer
.
save
(
"
model_final
"
,
**
arguments
)
...
...
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