-
Notifications
You must be signed in to change notification settings - Fork 521
Add FloodForecaster: Domain-Adaptive GINO Framework for Flood Forecasting #1271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 40 commits
313d4d0
5371dc6
24c7c51
29ec0ce
3ef4bab
b02726b
26d700c
c1e764a
07592ee
0ec972e
3b9d7ce
cf4137c
1d38b30
a73cf67
cc01767
151c830
9ca0b8f
0c5dbe1
5aa7b62
453fa55
87b18ee
aadd743
61d6605
2cbc592
037e4e0
06bb3c5
625405d
b3502da
ac98fb4
b60f9bf
44d20fb
2d3b737
9f22d11
c6f2627
761feb0
7721256
9d0d68b
36d6468
8ad71cf
2aa1bf8
b77e423
bcb4df1
97e0cf5
949a081
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2023 - 2025 NVIDIA CORPORATION & AFFILIATES. | ||
| # SPDX-FileCopyrightText: All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Configuration file for FloodForecaster training. | ||
| # This file is used by Hydra to configure the training run. | ||
|
|
||
| hydra: | ||
| job: | ||
| chdir: True # Change directory to the job's working directory. | ||
| run: | ||
| dir: ./outputs/ # Directory to save outputs. | ||
|
|
||
| # Distributed computing | ||
| distributed: | ||
| use_distributed: false | ||
| wireup_info: 'mpi' | ||
| wireup_store: 'tcp' | ||
| model_parallel_size: 1 | ||
| seed: 123 | ||
| device: 'cuda:0' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we set |
||
|
|
||
| # Dataset related for training and one-step evaluation | ||
| source_data: | ||
| root: "${DATA_ROOT:/path/to/source/data}" # Set DATA_ROOT environment variable or update this path | ||
| resolution: 48 | ||
| n_history: 3 | ||
| batch_size: 8 | ||
| query_res: [48, 48] | ||
| xy_file: "M40_XY.txt" | ||
| static_files: | ||
| - "M40_XY.txt" | ||
| - "M40_CA.txt" | ||
| - "M40_CE.txt" | ||
| - "M40_CS.txt" | ||
| - "M40_FA.txt" | ||
| - "M40_A.txt" | ||
| - "M40_CU.txt" | ||
| dynamic_patterns: | ||
| WD: "M40_WD_{}.txt" | ||
| VX: "M40_VX_{}.txt" | ||
| VY: "M40_VY_{}.txt" | ||
| boundary_patterns: | ||
| inflow: "M40_US_InF_{}.txt" | ||
| noise_type: "none" | ||
| noise_std: [0.01, 0.001, 0.001] | ||
| rollout_length: 78 | ||
| skip_before_timestep: 12 | ||
| dt: 1200 | ||
|
|
||
| # Target domain dataset | ||
| target_data: | ||
| root: "${TARGET_DATA_ROOT:/path/to/target/data}" # Set TARGET_DATA_ROOT environment variable or update this path | ||
| resolution: 48 | ||
| n_history: 3 | ||
| batch_size: 8 | ||
| query_res: [48, 48] | ||
| xy_file: "M40_XY.txt" | ||
| static_files: | ||
| - "M40_XY.txt" | ||
| - "M40_CA.txt" | ||
| - "M40_CE.txt" | ||
| - "M40_CS.txt" | ||
| - "M40_FA.txt" | ||
| - "M40_A.txt" | ||
| - "M40_CU.txt" | ||
| dynamic_patterns: | ||
| WD: "M40_WD_{}.txt" | ||
| VX: "M40_VX_{}.txt" | ||
| VY: "M40_VY_{}.txt" | ||
| boundary_patterns: | ||
| inflow: "M40_US_InF_{}.txt" | ||
| noise_type: "none" | ||
| noise_std: [0.01, 0.001, 0.001] | ||
| rollout_length: 78 | ||
| skip_before_timestep: 12 | ||
| dt: 1200 | ||
|
|
||
| # Rollout evaluation dataset | ||
| rollout_data: | ||
| root: "${ROLLOUT_DATA_ROOT:/path/to/rollout/data}" # Set ROLLOUT_DATA_ROOT environment variable or update this path | ||
| xy_file: "M40_XY.txt" | ||
| static_files: | ||
| - "M40_XY.txt" | ||
| - "M40_CA.txt" | ||
| - "M40_CE.txt" | ||
| - "M40_CS.txt" | ||
| - "M40_FA.txt" | ||
| - "M40_A.txt" | ||
| - "M40_CU.txt" | ||
| dynamic_patterns: | ||
| WD: "M40_WD_{}.txt" | ||
| VX: "M40_VX_{}.txt" | ||
| VY: "M40_VY_{}.txt" | ||
| boundary_patterns: | ||
| inflow: "M40_US_InF_{}.txt" | ||
|
|
||
| # Model configuration (for neuralop get_model compatibility) | ||
| model: | ||
| model_arch: 'gino' | ||
| data_channels: 20 | ||
| out_channels: 3 | ||
| latent_feature_channels: null | ||
| projection_channel_ratio: 4 | ||
| gno_coord_dim: 2 | ||
| in_gno_radius: 0.1 | ||
| out_gno_radius: 0.1 | ||
| in_gno_transform_type: 'linear' | ||
| out_gno_transform_type: 'linear' | ||
| gno_weighting_function: null | ||
| gno_weight_function_scale: 1.0 | ||
| in_gno_pos_embed_type: 'transformer' | ||
| out_gno_pos_embed_type: 'transformer' | ||
| fno_in_channels: 20 | ||
| fno_n_modes: [16, 16] | ||
| fno_hidden_channels: 64 | ||
| fno_lifting_channel_ratio: 2 | ||
| fno_n_layers: 4 | ||
| gno_embed_channels: 32 | ||
| gno_embed_max_positions: 10000 | ||
| in_gno_channel_mlp_hidden_layers: [80, 80, 80] | ||
| out_gno_channel_mlp_hidden_layers: [512, 256] | ||
| gno_use_open3d: false | ||
| gno_use_torch_scatter: false | ||
| out_gno_tanh: null | ||
| fno_resolution_scaling_factor: null | ||
| fno_block_precision: 'full' | ||
| fno_use_channel_mlp: true | ||
| fno_channel_mlp_dropout: 0 | ||
| fno_channel_mlp_expansion: 0.5 | ||
| fno_norm: 'instance_norm' | ||
| fno_ada_in_features: 16 | ||
| fno_ada_in_dim: 1 | ||
| fno_preactivation: false | ||
| fno_skip: 'linear' | ||
| fno_channel_mlp_skip: 'soft-gating' | ||
| fno_separable: false | ||
| fno_factorization: 'tucker' | ||
| fno_rank: 0.4 | ||
| fno_fixed_rank_modes: false | ||
| fno_implementation: 'factorized' | ||
|
|
||
| # Checkpoint configuration | ||
| checkpoint: | ||
| save_dir: "./checkpoints_flood_forecaster" | ||
| resume_from_dir: null | ||
| resume_from_source: null | ||
| resume_from_adapt: null | ||
|
Comment on lines
+167
to
+169
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these needed? If som please describe how these should be used. |
||
| # Pretraining checkpoint saving options | ||
| save_best: "source_val_l2" # Metric to monitor for best model saving (e.g., "source_val_l2") | ||
| # Set to null to disable best model saving | ||
| save_every: null # Save checkpoint every N epochs (e.g., 10). Set to null to disable interval saving | ||
| # Note: save_best takes precedence over save_every if both are set | ||
|
|
||
| # Rollout output directory | ||
| rollout: | ||
| out_dir: "./rollout_outputs" | ||
|
|
||
| # Optimization settings | ||
| training: | ||
| n_epochs: 4 | ||
| n_epochs_source: 2 | ||
| n_epochs_adapt: 2 | ||
| learning_rate: 1e-4 | ||
| adapt_learning_rate: 1e-4 | ||
| training_loss: 'l2' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. List the available options in a comment |
||
| testing_loss: 'l2' | ||
| weight_decay: 1e-4 | ||
| amp_autocast: false | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. List the available options in a comment |
||
| scheduler: 'StepLR' | ||
| scheduler_T_max: 200 | ||
| scheduler_patience: 5 | ||
| step_size: 50 | ||
| gamma: 0.5 | ||
| da_class_loss_weight: 0.0 | ||
| da_lambda_max: 1.0 | ||
| da_classifier: | ||
| conv_layers: | ||
| - out_channels: 64 | ||
| kernel_size: 3 | ||
| pool_size: 2 | ||
| fc_dim: 1 | ||
|
|
||
| # Weights & Biases logging | ||
| wandb: | ||
| log: false | ||
| name: null | ||
| group: 'flood-experiments' | ||
| project: 'Flood_GINO_NoPhysics' | ||
| entity: 'uva_mehdi' | ||
| sweep: false | ||
| log_output: true | ||
| eval_interval: 1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2023 - 2025 NVIDIA CORPORATION & AFFILIATES. | ||
| # SPDX-FileCopyrightText: All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| r"""Data processing modules for flood prediction.""" | ||
|
|
||
| from .data_processor import FloodGINODataProcessor, GINOWrapper, LpLossWrapper | ||
|
|
||
| __all__ = ["FloodGINODataProcessor", "GINOWrapper", "LpLossWrapper"] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to use physicsnemo distributed utilities instead?