Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mednet
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
medai
software
mednet
Commits
236447ec
Commit
236447ec
authored
10 months ago
by
Daniel CARRON
Browse files
Options
Downloads
Patches
Plain Diff
[trainer] Hardcode name of loss to monitor
parent
ae55d184
No related branches found
No related tags found
1 merge request
!38
Replace sampler balancing by loss balancing
Pipeline
#86794
passed
10 months ago
Stage: qa
Stage: doc
Stage: dist
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mednet/engine/trainer.py
+1
-3
1 addition, 3 deletions
src/mednet/engine/trainer.py
with
1 addition
and
3 deletions
src/mednet/engine/trainer.py
+
1
−
3
View file @
236447ec
...
@@ -93,8 +93,6 @@ def run(
...
@@ -93,8 +93,6 @@ def run(
main_pid
=
os
.
getpid
(),
main_pid
=
os
.
getpid
(),
)
)
monitor_key
=
"
loss/validation
"
# This checkpointer will operate at the end of every validation epoch
# This checkpointer will operate at the end of every validation epoch
# (which happens at each checkpoint period), it will then save the lowest
# (which happens at each checkpoint period), it will then save the lowest
# validation loss model observed. It will also save the last trained model
# validation loss model observed. It will also save the last trained model
...
@@ -102,7 +100,7 @@ def run(
...
@@ -102,7 +100,7 @@ def run(
dirpath
=
output_folder
,
dirpath
=
output_folder
,
filename
=
CHECKPOINT_ALIASES
[
"
best
"
],
filename
=
CHECKPOINT_ALIASES
[
"
best
"
],
save_last
=
True
,
# will (re)create the last trained model, at every iteration
save_last
=
True
,
# will (re)create the last trained model, at every iteration
monitor
=
monitor_key
,
monitor
=
"
loss/validation
"
,
mode
=
"
min
"
,
mode
=
"
min
"
,
save_on_train_epoch_end
=
True
,
save_on_train_epoch_end
=
True
,
every_n_epochs
=
validation_period
,
# frequency at which it checks the "monitor"
every_n_epochs
=
validation_period
,
# frequency at which it checks the "monitor"
...
...
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