Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calo Opt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Asfour
Calo Opt
Commits
7df4ce5c
Commit
7df4ce5c
authored
9 months ago
by
Lorenzo Asfour
Browse files
Options
Downloads
Patches
Plain Diff
fix: Correct learning rate update in optimizer, reconstruction, surrogate
parent
b48fabda
Branches
main
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/optimizer.py
+2
-1
2 additions, 1 deletion
modules/optimizer.py
modules/reconstruction.py
+2
-1
2 additions, 1 deletion
modules/reconstruction.py
modules/surrogate.py
+2
-1
2 additions, 1 deletion
modules/surrogate.py
with
6 additions
and
3 deletions
modules/optimizer.py
+
2
−
1
View file @
7df4ce5c
...
@@ -88,7 +88,8 @@ class Optimizer(object):
...
@@ -88,7 +88,8 @@ class Optimizer(object):
using the reconstruction model loss
using the reconstruction model loss
'''
'''
# set the optimizer
# set the optimizer
self
.
optimizer
.
lr
=
lr
for
param_group
in
self
.
optimizer
.
param_groups
:
param_group
[
'
lr
'
]
=
lr
self
.
surrogate_model
.
eval
()
self
.
surrogate_model
.
eval
()
self
.
reconstruction_model
.
eval
()
self
.
reconstruction_model
.
eval
()
...
...
This diff is collapsed.
Click to expand it.
modules/reconstruction.py
+
2
−
1
View file @
7df4ce5c
...
@@ -52,7 +52,8 @@ class Reconstruction(torch.nn.Module):
...
@@ -52,7 +52,8 @@ class Reconstruction(torch.nn.Module):
train_loader
=
DataLoader
(
dataset
,
batch_size
=
batch_size
,
shuffle
=
True
)
train_loader
=
DataLoader
(
dataset
,
batch_size
=
batch_size
,
shuffle
=
True
)
# set the optimizer
# set the optimizer
self
.
optimizer
.
lr
=
lr
for
param_group
in
self
.
optimizer
.
param_groups
:
param_group
[
'
lr
'
]
=
lr
self
.
to
(
self
.
device
)
self
.
to
(
self
.
device
)
self
.
train
()
self
.
train
()
for
epoch
in
range
(
n_epochs
):
for
epoch
in
range
(
n_epochs
):
...
...
This diff is collapsed.
Click to expand it.
modules/surrogate.py
+
2
−
1
View file @
7df4ce5c
...
@@ -158,7 +158,8 @@ class Surrogate(torch.nn.Module):
...
@@ -158,7 +158,8 @@ class Surrogate(torch.nn.Module):
# train the surrogate model
# train the surrogate model
train_loader
=
DataLoader
(
surrogate_dataset
,
batch_size
=
batch_size
,
shuffle
=
True
)
train_loader
=
DataLoader
(
surrogate_dataset
,
batch_size
=
batch_size
,
shuffle
=
True
)
# set the optimizer
# set the optimizer
self
.
optimizer
.
lr
=
lr
for
param_group
in
self
.
optimizer
.
param_groups
:
param_group
[
'
lr
'
]
=
lr
self
.
to
(
self
.
device
)
self
.
to
(
self
.
device
)
self
.
train
()
self
.
train
()
...
...
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