Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-harmonics
Commits
3f125603
Commit
3f125603
authored
Dec 12, 2024
by
Boris Bonev
Committed by
Boris Bonev
Jan 14, 2025
Browse files
fixing sclae factor logic to assume that the poles are included in the latitiude grid
parent
4369d182
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
examples/train_sfno.py
examples/train_sfno.py
+1
-1
torch_harmonics/examples/sfno/models/local_sfno.py
torch_harmonics/examples/sfno/models/local_sfno.py
+2
-2
torch_harmonics/examples/sfno/models/sfno.py
torch_harmonics/examples/sfno/models/sfno.py
+2
-2
No files found.
examples/train_sfno.py
View file @
3f125603
...
@@ -373,7 +373,7 @@ def main(train=True, load_checkpoint=False, enable_amp=False, log_grads=0):
...
@@ -373,7 +373,7 @@ def main(train=True, load_checkpoint=False, enable_amp=False, log_grads=0):
dt
=
1
*
3600
dt
=
1
*
3600
dt_solver
=
150
dt_solver
=
150
nsteps
=
dt
//
dt_solver
nsteps
=
dt
//
dt_solver
dataset
=
PdeDataset
(
dt
=
dt
,
nsteps
=
nsteps
,
dims
=
(
25
6
,
512
),
device
=
device
,
normalize
=
True
)
dataset
=
PdeDataset
(
dt
=
dt
,
nsteps
=
nsteps
,
dims
=
(
25
7
,
512
),
device
=
device
,
normalize
=
True
)
# There is still an issue with parallel dataloading. Do NOT use it at the moment
# There is still an issue with parallel dataloading. Do NOT use it at the moment
# dataloader = DataLoader(dataset, batch_size=4, shuffle=True, num_workers=4, persistent_workers=True)
# dataloader = DataLoader(dataset, batch_size=4, shuffle=True, num_workers=4, persistent_workers=True)
dataloader
=
DataLoader
(
dataset
,
batch_size
=
4
,
shuffle
=
True
,
num_workers
=
0
,
persistent_workers
=
False
)
dataloader
=
DataLoader
(
dataset
,
batch_size
=
4
,
shuffle
=
True
,
num_workers
=
0
,
persistent_workers
=
False
)
...
...
torch_harmonics/examples/sfno/models/local_sfno.py
View file @
3f125603
...
@@ -454,8 +454,8 @@ class LocalSphericalNeuralOperatorNet(nn.Module):
...
@@ -454,8 +454,8 @@ class LocalSphericalNeuralOperatorNet(nn.Module):
else
:
else
:
raise
ValueError
(
f
"Unknown activation function
{
activation_function
}
"
)
raise
ValueError
(
f
"Unknown activation function
{
activation_function
}
"
)
# compute downsampled image size
# compute downsampled image size
. We assume that the latitude-grid includes both poles
self
.
h
=
self
.
img_size
[
0
]
//
scale_factor
self
.
h
=
(
self
.
img_size
[
0
]
-
1
)
//
scale_factor
self
.
w
=
self
.
img_size
[
1
]
//
scale_factor
self
.
w
=
self
.
img_size
[
1
]
//
scale_factor
# dropout
# dropout
...
...
torch_harmonics/examples/sfno/models/sfno.py
View file @
3f125603
...
@@ -325,8 +325,8 @@ class SphericalFourierNeuralOperatorNet(nn.Module):
...
@@ -325,8 +325,8 @@ class SphericalFourierNeuralOperatorNet(nn.Module):
else
:
else
:
raise
ValueError
(
f
"Unknown activation function
{
activation_function
}
"
)
raise
ValueError
(
f
"Unknown activation function
{
activation_function
}
"
)
# compute downsampled image size
# compute downsampled image size
. We assume that the latitude-grid includes both poles
self
.
h
=
self
.
img_size
[
0
]
//
scale_factor
self
.
h
=
(
self
.
img_size
[
0
]
-
1
)
//
scale_factor
self
.
w
=
self
.
img_size
[
1
]
//
scale_factor
self
.
w
=
self
.
img_size
[
1
]
//
scale_factor
# dropout
# dropout
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment