Skip to content

Commit f69a426

Browse files
committed
Merge main
2 parents 8d8657d + e4e5756 commit f69a426

19 files changed

Lines changed: 5316 additions & 74 deletions

CONTRIBUTING.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ You can run `uv run -m ocean_emulators.train --help` to see all the options avai
170170
To learn more about other datasets used during training, please see the _Data Engineering_ section below.
171171

172172
To run a remote training job with Skypilot, use the following command:
173+
173174
```shell
174175
# export WANDB_API_KEY=<my-key> # Get your key at https://wandb.ai/authorize
175-
# sky launch -c fomo-cluster train.sky.yaml --env WANDB_API_KEY --env-file <my-vars>.env
176+
uv run sky launch train.sky.yaml --env WANDB_API_KEY --env-file <my-vars>.env
176177
```
177178

178179
Please read the docstring in the `train.sky.yaml` for more information.
@@ -186,10 +187,26 @@ uv run scripts/clone_data.py $DATA_PATH --compact_variables
186187
uv run -m ocean_emulators.eval configs/eval_om4.yaml --ckpt_path path/to/checkpoint --experiment.data_root $DATA_PATH
187188
```
188189

190+
This produces a `predictions.zarr` file in the output directory with the rollout of the model.
191+
189192
You can run `uv run -m ocean_emulators.eval --help` to see all the options available.
190193

191194
To learn more about other datasets used during evaluation, please see the _Data Engineering_ section below.
192195

196+
### Visualizing outputs from the model
197+
198+
```bash
199+
uv run -m ocean_emulators.viz configs/viz_om4.yaml --data_root path/to/data --name my_experiment_viz --runs='[{"name": "my_experiment", "location": "path/to/eval/output/predictions.zarr"}]'
200+
```
201+
202+
You can run `uv run -m ocean_emulators.viz --help` to see all the options available.
203+
204+
After making changes to the visualization code, you can run the following command to compare old and new plots:
205+
206+
```bash
207+
uv run -m ocean_emulators.utils.compare path/to/old/viz path/to/new/viz
208+
```
209+
193210
## Configuration
194211

195212
### Configuration files

configs/data/om4_sky_local.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

configs/data/public.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
data_location: OM4.zarr
44
data_means_location: OM4_means.zarr
55
data_stds_location: OM4_stds.zarr
6-
static_data_vars: []
6+
static_data_vars: []
7+
concurrent_compute: true

configs/eval_om4_halfdeg.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# yaml-language-server: $schema=schemas/EvalConfig.json
2+
3+
debug: false
4+
save_zarr: true
5+
disk_mode: true
6+
inference_time:
7+
start: "2014-10-10"
8+
end: "2022-12-24"
9+
num_model_steps_forward: -1
10+
11+
experiment:
12+
name: local_om4_samudra
13+
rand_seed: 15
14+
base_output_dir: .LOCAL
15+
wandb:
16+
mode: online
17+
project: ocean-emulators
18+
entity: m2lines
19+
group: samudra-eval-om4
20+
network: Samudra
21+
prognostic_vars_key: thermo_dynamic_all
22+
boundary_vars_key: tau_hfds_hfds_anom
23+
24+
data: !include data/public.yaml
25+
26+
samudra:
27+
checkpointing: all
28+
ch_width: [157, 280, 380, 480, 520]
29+
n_out: 154
30+
dilation: [1, 2, 4, 8]
31+
n_layers: [1, 1, 1, 1]
32+
pred_residuals: false
33+
last_kernel_size: 3
34+
pad: "circular"
35+
36+
core_block:
37+
block_type: "conv_next_block"
38+
kernel_size: 3
39+
activation: "capped_gelu"
40+
upscale_factor: 2
41+
norm: "batch"
42+
43+
down_sampling_block: "avg_pool"
44+
up_sampling_block: "bilinear_upsample"
45+
46+
corrector:
47+
non_negative_corrector_names: null
48+
ocean_heat_corrector: false

configs/train_om4_halfdeg.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ disk_mode: true
55
pin_mem: true
66
save_freq: 5
77
epochs: 70
8-
batch_size: 2
9-
learning_rate: 0.0002
8+
batch_size: 3
9+
learning_rate: 0.0006
1010
scheduler: { type: cosine }
1111
loss: mse
1212
finetune: false
@@ -44,7 +44,7 @@ preemptible: false
4444
backend: auto
4545

4646
experiment:
47-
name: om4_samudra_halfdeg
47+
name: om4_samudra_halfdeg_wide
4848
rand_seed: 15
4949
base_output_dir: .LOCAL
5050
wandb:
@@ -55,11 +55,12 @@ experiment:
5555
prognostic_vars_key: thermo_dynamic_all
5656
boundary_vars_key: tau_hfds_hfds_anom
5757
data:
58-
!include data/om4_halfdeg_remote.yaml
58+
!include data/public.yaml
5959

6060
samudra:
61-
ch_width: [157, 200, 250, 300, 400]
62-
n_out: 77
61+
checkpointing: all
62+
ch_width: [157, 280, 380, 480, 520]
63+
n_out: 154
6364
dilation: [1, 2, 4, 8]
6465
n_layers: [1, 1, 1, 1]
6566
pred_residuals: false
@@ -70,7 +71,7 @@ samudra:
7071
block_type: "conv_next_block"
7172
kernel_size: 3
7273
activation: "capped_gelu"
73-
upscale_factor: 4
74+
upscale_factor: 2
7475
norm: "batch"
7576

7677
down_sampling_block: "avg_pool"

configs/viz_om4.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# yaml-language-server: $schema=schemas/VizConfig.json
2+
3+
base_output_dir: ".LOCAL"
4+
name: "viz_om4_halfdeg"
5+
dataset_name: "OM4"
6+
groundtruth_location: "OM4.zarr"
7+
basins_location:
8+
type: s3
9+
bucket: "emulators"
10+
path: "jr7309/basins/basin_masks_original.zarr"
11+
endpoint_url: "https://nyu1.osn.mghpcc.org"
12+
groundtruth_time_range:
13+
start: "2014-10-20"
14+
end: "2022-12-24"
15+
runs:
16+
- name: "local_om4_samudra"
17+
location: ".LOCAL/local_om4_samudra/predictions.zarr"

configs/viz_om4_halfdeg.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# yaml-language-server: $schema=schemas/VizConfig.json
2+
3+
base_output_dir: ".LOCAL"
4+
name: "viz_om4_halfdeg"
5+
dataset_name: "OM4"
6+
groundtruth_location: "OM4.zarr"
7+
basins_location:
8+
type: s3
9+
bucket: "emulators"
10+
path: "jr7309/basins/basin_masks_regridded.zarr"
11+
endpoint_url: "https://nyu1.osn.mghpcc.org"
12+
groundtruth_time_range:
13+
start: "2014-10-20"
14+
end: "2022-12-24"
15+
runs:
16+
- name: "local_om4_samudra"
17+
location: ".LOCAL/local_om4_samudra/predictions.zarr"

0 commit comments

Comments
 (0)