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
9eb1e023
Commit
9eb1e023
authored
1 year ago
by
Daniel CARRON
Committed by
André Anjos
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Check if set_normalizer method is defined in model
parent
5bb7387f
No related branches found
No related tags found
1 merge request
!6
Making use of LightningDataModule and simplification of data loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ptbench/scripts/train.py
+6
-1
6 additions, 1 deletion
src/ptbench/scripts/train.py
with
6 additions
and
1 deletion
src/ptbench/scripts/train.py
+
6
−
1
View file @
9eb1e023
...
@@ -256,7 +256,12 @@ def train(
...
@@ -256,7 +256,12 @@ def train(
# Sets the model normalizer with the unaugmented-train-subset.
# Sets the model normalizer with the unaugmented-train-subset.
# this call may be a NOOP, if the model was pre-trained and expects
# this call may be a NOOP, if the model was pre-trained and expects
# different weights for the normalisation layer.
# different weights for the normalisation layer.
model
.
set_normalizer
(
datamodule
.
train_dataloader
())
if
hasattr
(
model
,
"
set_normalizer
"
):
model
.
set_normalizer
(
datamodule
.
train_dataloader
())
else
:
logger
.
info
(
f
"
Model
{
model
.
name
}
has no
'
set_normalizer
'
method. No normalization will be applied.
"
)
# Rebalances the loss criterion based on the relative proportion of class
# Rebalances the loss criterion based on the relative proportion of class
# examples available in the training set. Also affects the validation loss
# examples available in the training set. Also affects the validation loss
...
...
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