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
e0f87834
Commit
e0f87834
authored
8 months ago
by
Daniel CARRON
Committed by
André Anjos
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[common.engine.callbacks] Get lr from optimizer if no scheduler defined
parent
993945b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!46
Create common library
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mednet/libs/common/engine/callbacks.py
+7
-3
7 additions, 3 deletions
src/mednet/libs/common/engine/callbacks.py
with
7 additions
and
3 deletions
src/mednet/libs/common/engine/callbacks.py
+
7
−
3
View file @
e0f87834
...
...
@@ -141,9 +141,13 @@ class LoggingCallback(lightning.pytorch.Callback):
epoch_time
=
time
.
time
()
-
self
.
_start_training_epoch_time
self
.
_to_log
[
"
epoch-duration-seconds/train
"
]
=
epoch_time
self
.
_to_log
[
"
learning-rate
"
]
=
pl_module
.
trainer
.
lr_scheduler_configs
[
0
].
scheduler
.
optimizer
.
param_groups
[
0
][
"
lr
"
]
# type: ignore
if
len
(
pl_module
.
trainer
.
lr_scheduler_configs
)
==
0
:
self
.
_to_log
[
"
learning-rate
"
]
=
pl_module
.
optimizers
().
defaults
[
"
lr
"
]
else
:
self
.
_to_log
[
"
learning-rate
"
]
=
pl_module
.
trainer
.
lr_scheduler_configs
[
0
].
scheduler
.
optimizer
.
param_groups
[
0
][
"
lr
"
]
# type: ignore
overall_cycle_time
=
time
.
time
()
-
self
.
_start_training_epoch_time
self
.
_to_log
[
"
cycle-time-seconds/train
"
]
=
overall_cycle_time
...
...
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