Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
e804d53
allow matching of different forecast hours
andrewjustin Sep 29, 2023
3547fd7
remove underscores for model name in output files
andrewjustin Sep 29, 2023
1b5c8a6
add numerical frontal analysis methods
andrewjustin Oct 6, 2023
254d4bc
add ECMWF to file loader
andrewjustin Oct 21, 2023
37638b5
begin developing permutation studies code
andrewjustin Oct 23, 2023
835b7f6
add new relative humidity function
andrewjustin Oct 23, 2023
f766bb5
add HRRR, NAMNEST conus, NAM 12km grids
andrewjustin Oct 24, 2023
f15a728
add open contours
andrewjustin Oct 24, 2023
8e7a862
update script version
andrewjustin Oct 24, 2023
5884532
update relative humidity function
andrewjustin Oct 24, 2023
4fa7770
update NAM filename format
andrewjustin Oct 24, 2023
d309095
remove repetitive dataset opening
andrewjustin Oct 24, 2023
f3306fb
add HRRR, NAM 12km, NAMNEST-conus coordinates
andrewjustin Oct 24, 2023
d755f80
code touch-ups
andrewjustin Oct 24, 2023
7ab5135
code touch-ups
andrewjustin Oct 24, 2023
b83cd97
add ECMWF to grib-netcdf script
andrewjustin Nov 5, 2023
089858c
documentation update
andrewjustin Nov 5, 2023
73feefb
finish multi-pass permutations, create plot script
andrewjustin Nov 5, 2023
210215f
add POD to loss/metric scripts
andrewjustin Nov 9, 2023
f843176
add new argument so old front files can be paired
andrewjustin Nov 9, 2023
b596f17
make multi-pass permutations not required
andrewjustin Nov 9, 2023
a1f8371
add labels for horizontal bars
andrewjustin Nov 9, 2023
a94d210
add saliency map generation code
andrewjustin Nov 13, 2023
1b28edc
fix front expansion code
andrewjustin Nov 16, 2023
cc1378b
add saliency map plotting code
andrewjustin Nov 16, 2023
f70dccb
add ocean domains, update lat/lon slicing method
andrewjustin Nov 16, 2023
f326d94
first commit for new README
andrewjustin Nov 21, 2023
9cc5c51
continue writing README
andrewjustin Nov 23, 2023
a260d73
continue README.md development
andrewjustin Nov 23, 2023
70b2ad9
continue README.md development
andrewjustin Nov 26, 2023
e1d6d09
continue README.md development
andrewjustin Nov 26, 2023
bfc6682
continue README.md development
andrewjustin Nov 26, 2023
6b77944
continue README.md development
andrewjustin Nov 26, 2023
3095ce9
continue README.md development
andrewjustin Nov 26, 2023
88d6aac
continue README.md development
andrewjustin Nov 26, 2023
3e9562b
continue README.md development
andrewjustin Nov 26, 2023
ab8ed64
continue README.md development
andrewjustin Nov 26, 2023
1c0a465
continue README.md development
andrewjustin Nov 26, 2023
f01e75f
continue README.md development
andrewjustin Nov 26, 2023
12e6abd
continue README.md development
andrewjustin Nov 27, 2023
a1e4dda
fix attention UNET link
andrewjustin Nov 29, 2023
ce484e0
new activations, bug fixes, code cleanup
andrewjustin Dec 10, 2023
ff866c6
activation debugging, still more to do
andrewjustin Dec 12, 2023
24fb015
updates to activations, losses/metrics, README
andrewjustin Dec 19, 2023
d95de4f
fix bug with type check
andrewjustin Dec 19, 2023
4f65190
fix another bug with type check
andrewjustin Dec 19, 2023
b10eda5
rename and add variables to settings
andrewjustin Jan 6, 2024
35f9f6b
start updates for wandb, fix wind component bug
andrewjustin Jan 25, 2024
27e8420
large updates
andrewjustin Apr 6, 2024
cd6a5cb
fix PATH issues
andrewjustin Apr 6, 2024
dd29337
add output activation option to models
andrewjustin Apr 6, 2024
dc39393
bug fix
andrewjustin Apr 29, 2024
7935108
more HRRR/NAM support, other updates
andrewjustin May 19, 2024
800b9ce
add GEFS, dates with missing fronts
andrewjustin Jun 9, 2024
ce07aeb
add GOES-16/17 data workflow
andrewjustin Aug 3, 2024
477f16b
Finish satellite data integration
andrewjustin Aug 11, 2024
bbae4ac
fix bugs in satellite workflow
andrewjustin Aug 25, 2024
fa91547
add requirements.txt
andrewjustin Aug 29, 2024
2208577
start adding MERGIR workflow
andrewjustin Sep 4, 2024
3a7d0cf
start webapp design + README updates
andrewjustin Sep 6, 2024
d3cc8aa
add model speed testing script
andrewjustin Oct 10, 2024
9080de2
change vertical level names from mb to hPa
andrewjustin Oct 10, 2024
221add6
rearrange and rename files
andrewjustin Oct 11, 2024
b2ab73c
change default ERA5 domain to global
andrewjustin Oct 12, 2024
5260586
minor fixes, statistical dataset separation
andrewjustin Nov 15, 2024
7f2324d
GOES satellite, updates to evaluation workflow
andrewjustin Dec 20, 2024
9da5d5a
add support for MERGIR predictions
andrewjustin Dec 26, 2024
b11cb76
add failsafe to merge_goes_satellite.py
andrewjustin Dec 28, 2024
81a8150
GOES workflow updated, HSS bug fixed
andrewjustin Feb 1, 2025
e5dc438
add ERA5 download, add front files to tensorflow
andrewjustin Mar 6, 2025
5f8751d
create front plotting script
andrewjustin Mar 22, 2025
3a81a71
remove variable function typehints
andrewjustin Mar 22, 2025
2963478
big update for new slicing workflow
andrewjustin May 3, 2025
381fad3
add pixi related files and modifications
Dec 29, 2025
447843a
update pixi files with dependencies
aaTman Jan 1, 2026
f634e9f
Merge pull request #1 from aaTman/taylor/pixi
aaTman Jan 5, 2026
2f26135
add gitignore for wandb
aaTman Jan 28, 2026
cd65358
new file structure
aaTman Jan 28, 2026
17ceab4
Merge pull request #2 from aaTman/chore/change-file-structure
aaTman Jan 29, 2026
0b4f183
swap pyproj and pixi toml, new pixi lock
aaTman Jan 29, 2026
62bfcc7
add constants module
aaTman Jan 29, 2026
81f8534
Merge pull request #3 from aaTman:chore/replace-pixi-with-pyproject
aaTman Jan 29, 2026
8b6590b
ruff formatting all files
aaTman Jan 29, 2026
2885946
Merge pull request #4 from aaTman:chore/ruff-formatting
aaTman Jan 29, 2026
e17c6ed
add tensorflow[and-cuda] to pyproject, 12.4 to cuda, and update pixi …
aaTman Jan 30, 2026
0231914
Merge pull request #5 from aaTman:feat/tensorflow-2.16-cuda-12.4
aaTman Jan 30, 2026
8994524
add hatch build and move pypi dependencies to explicit tool.pixi.pypi…
aaTman Jan 30, 2026
15751b3
add submodules in init
aaTman Jan 30, 2026
46ddc9e
update imports, add packages to pyproject for imports not included yet
aaTman Jan 30, 2026
a0201c0
update lockfile
aaTman Jan 30, 2026
bac00b1
add s3fs
aaTman Jan 30, 2026
de2a3e6
Merge pull request #6 from aaTman:chore/update-imports
aaTman Jan 30, 2026
4b4b5ed
move train_unet to train_legacy
aaTman Feb 4, 2026
dd3bd72
update pyproject with newer wandb version
aaTman Feb 4, 2026
dac50a8
build new train module with dataclass + dacite config approach
aaTman Feb 4, 2026
7a1cee1
update pyproject and lockfile
aaTman Feb 4, 2026
57d6a74
Merge pull request #7 from aaTman:chore/add-h5py-to-pyproject
aaTman Feb 4, 2026
262c1e2
Merge branch 'taylor/main' into feat/train-update
aaTman Feb 4, 2026
f0d552a
update tensorflow keras import
aaTman Feb 4, 2026
c7fdf6b
add callbacks config logic
aaTman Feb 4, 2026
f9859b7
update docstrings, create dacite helper function
aaTman Feb 4, 2026
ac0b94e
update comments
aaTman Feb 4, 2026
23b9935
remove non-training code for different pr, add require arg, move args…
aaTman Feb 5, 2026
1c249d2
remove tf import for now
aaTman Feb 5, 2026
c79fb5f
Merge pull request #8 from aaTman:feat/train-update
aaTman Feb 5, 2026
3cd0210
update pyproject and pixi lock for package; update file manager imports
aaTman Feb 6, 2026
a1dd2cc
update deps for era5 access and xbatcher
aaTman Feb 11, 2026
4353cb1
add era5 and batch modules
aaTman Feb 11, 2026
83b0e89
variables -> calc (better name to avoid conflicts), fix data_utils to…
aaTman Feb 11, 2026
d156250
Merge pull request #9 from aaTman:data/xbatcher
aaTman Feb 11, 2026
f246db3
init commit; mid flight update with config dataclasses still needed f…
aaTman Feb 12, 2026
3b2248f
Mid flight update to config dc's
aaTman Feb 12, 2026
31a6a0e
update keras_builders for all model components
aaTman Feb 13, 2026
fe4fbe5
turn registry into property
aaTman Feb 13, 2026
1c55f92
remove field from activation registry
aaTman Feb 13, 2026
f8dae09
swap activations to new builder
aaTman Feb 13, 2026
5dba217
bookkeeping of inputs
aaTman Feb 13, 2026
207efbe
update regular classes to reflect arg names going into unet kwargs
aaTman Feb 13, 2026
8195c7f
update 1702 config yaml example
aaTman Feb 13, 2026
5978c39
move lossesconfig to keras_builders and change build object to "metho…
aaTman Feb 13, 2026
6c47c91
remove lossconfig
aaTman Feb 13, 2026
76f7a4f
change models dir to layers, move keras_builders to utils
aaTman Feb 13, 2026
8383f52
mid-flight updating model.py; managing interactions between unets and…
aaTman Feb 13, 2026
a33904b
bookkeeping on legacy train module
aaTman Feb 13, 2026
501128f
typing changes and config organization
aaTman Feb 13, 2026
ab62a26
set unets as classes (wip)
aaTman Feb 14, 2026
cf6e2f0
renamings
aaTman Feb 14, 2026
322f835
swap unets to classes
aaTman Feb 14, 2026
4d3ba71
Model builds via UNetRegistry
aaTman Feb 14, 2026
d376f0a
remove unused import
aaTman Feb 14, 2026
f238036
Fix 12 bugs across config ingestion and training pipeline
aaTman Feb 18, 2026
8f79bae
Add test suite for config ingestion pipeline
aaTman Feb 18, 2026
e99a881
add ds_store to gitignore
aaTman Feb 18, 2026
ae7e64c
swap list style
aaTman Feb 18, 2026
ea2a20e
Add data loading pipeline for training and prediction
aaTman Feb 20, 2026
04e91ba
Fix tf.keras.Activation AttributeError for TF 2.x compatibility
aaTman Feb 22, 2026
e384e24
Bypass normalize_dataset — incompatible with ARCO variable naming
aaTman Feb 22, 2026
e4cff6b
Support YYYYMM subdirectory layout in FrontsDataConfig
aaTman Feb 22, 2026
cd12c63
Add TFDatasetConfig for loading pre-built TF dataset snapshots
aaTman Feb 23, 2026
0afe0eb
Add logging throughout data pipeline and fix missing return in ERA5Pr…
aaTman Feb 23, 2026
f770f8f
update wandb filepath
aaTman Feb 24, 2026
504d103
Add --dry_run flag and fix WandbModelCheckpoint filepath
aaTman Feb 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ coverage.xml

# Django stuff:
*.log
local_settings.py
local_data_utils.py
db.sqlite3
db.sqlite3-journal

Expand Down Expand Up @@ -130,3 +130,12 @@ dmypy.json

# For PyCharm
.idea
# pixi environments
.pixi/*
!.pixi/config.toml

# wandb
wandb/

# osx files
.DS_Store
436 changes: 435 additions & 1 deletion README.md

Large diffs are not rendered by default.

124 changes: 124 additions & 0 deletions configs/1702.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
epochs: 5000
training_steps_per_epoch: 30
validation_steps_per_epoch:
validation_frequency: 1
verbose: 1
repeat: true
seed: 42

model:
name: "unet_3plus"
batch_normalization: true
num_filters: [16, 32, 64, 128]
kernel_size: [5, 5, 5]
pool_size: [2, 2, 1]
upsample_size: [2, 2, 1]
depth: 4
modules_per_node: 2
padding: "same"
bias: true
loss:
name: "fractions_skill_score"
config:
mask_size: [3, 3]
metric:
name: "critical_success_index"
config:
class_weights: [0, 1, 1, 1, 1, 1]

optimizer:
name: "Adam"
config:
beta_1: 0.9
beta_2: 0.999

convolution_activity_regularizer:
regularizer:

bias_vector:
constraint:
initializer:
name: "zeros"
config:
regularizer:

kernel_matrix:
constraint:
initializer:
name: "glorot_uniform"
config:
regularizer:

activation:
name: "gelu"
config:






data:
train_years: [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019]
val_years: [2020]
test_years: [2021]
shuffle: true
normalization_method: "standard"

era5:
domain_extent: [-140.0, -60.0, 20.0, 60.0]
# Use canonical (pressure-level) names for variables that have both surface
# and pressure-level representations. Surface-only variables (e.g.
# "mean_sea_level_pressure") are listed here directly.
# The mapping from pressure-level name to surface name is defined in
# fronts.data.config.SURFACE_VARIABLE_MAP and applied automatically when
# "surface" appears in the levels list.
variables:
- "temperature" # surface counterpart: 2m_temperature
- "specific_humidity" # surface counterpart: surface_specific_humidity
- "u_component_of_wind" # surface counterpart: 10m_u_component_of_wind
- "v_component_of_wind" # surface counterpart: 10m_v_component_of_wind
- "mean_sea_level_pressure" # surface-only
# levels may contain "surface" and/or integer hPa values in any order.
# "surface" triggers loading of the surface counterpart for each variable.
levels: ["surface", 1000, 950, 900, 850]
store: "gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3"
chunks:
time: 48
consolidated: true

fronts:
directory: "/path/to/fronts/netcdf"
front_types: "MERGED-ALL"

batch:
input_sizes:
time: 1
latitude: 128
longitude: 128
target_sizes:
time: 1
latitude: 128
longitude: 128
prefetch_number: 3
preload_batch: false

wandb:
project_name: 'fronts'
model_run_name: '1702_retrain'
# -- Optional parameters --
# log_frequency:
# upload_checkpoints:
# api_key:
# wandb_filepath:

callbacks:
monitor: "val_loss"
verbose: 1
save_best_only: true
save_weights_only: false
save_freq: "epoch"
# model_checkpoint_path:
# csv_logger_path:
# patience:

93 changes: 93 additions & 0 deletions configs/1702_tf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
epochs: 5000
training_steps_per_epoch: 30
validation_steps_per_epoch:
validation_frequency: 1
verbose: 1
repeat: true
seed: 42

model:
name: "unet_3plus"
batch_normalization: true
num_filters: [16, 32, 64, 128]
kernel_size: [5, 5, 5]
pool_size: [2, 2, 1]
upsample_size: [2, 2, 1]
depth: 4
modules_per_node: 2
padding: "same"
bias: true
loss:
name: "fractions_skill_score"
config:
mask_size: [3, 3]
metric:
name: "critical_success_index"
config:
class_weights: [0, 1, 1, 1, 1, 1]

optimizer:
name: "Adam"
config:
beta_1: 0.9
beta_2: 0.999

convolution_activity_regularizer:
regularizer:

bias_vector:
constraint:
initializer:
name: "zeros"
config:
regularizer:

kernel_matrix:
constraint:
initializer:
name: "glorot_uniform"
config:
regularizer:

activation:
name: "gelu"
config:


data:
train_years: [2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020, 2021, 2022, 2024]
val_years: [2023]
test_years: []
shuffle: true

# Load pre-built TF dataset snapshots directly from disk.
# Subdirectory naming convention: {year}-{month}_tf (e.g. 2010-1_tf)
# train_years/val_years/test_years above are injected at build time —
# leave them as [] here.
tf_dataset:
directory: "/ourdisk/hpc/ai2es/fronts/raw_front_data/tf_datasets/5class-7lvl-conus"
train_years: []
val_years: []
test_years: []
shuffle: true
shuffle_buffer: 1000
prefetch: 3

wandb:
project_name: 'fronts'
model_run_name: '1702_retrain'
wandb_filepath: '/ourdisk/hpc/ai2es/tman/models/1702_retrain.keras'
# -- Optional parameters --
# log_frequency:
# upload_checkpoints:
# api_key:

callbacks:
monitor: "val_loss"
verbose: 1
save_best_only: true
save_weights_only: false
save_freq: "epoch"
model_checkpoint_path: "/ourdisk/hpc/ai2es/tman/models/1702_tf.keras"
csv_logger_path: "/ourdisk/hpc/ai2es/tman/logs/1702_tf.csv"
# patience: 55
53 changes: 53 additions & 0 deletions configs/predict_1702.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Prediction configuration for FrontFinder model 1702.
#
# This config is loaded as a PredictConfig via:
# from fronts.train import open_config_yaml_as_dataclass
# from fronts.data.config import PredictConfig
# cfg = open_config_yaml_as_dataclass("configs/predict_1702.yaml", PredictConfig)
# inputs_ds = cfg.build() # -> normalized xr.Dataset ready for model inference
#
# TIME SELECTION — uncomment exactly one block below.
# Use ISO 8601 format with a "T" separator (e.g. "2024-06-01T12:00:00") so that
# PyYAML treats the value as a string rather than a date, allowing dacite to cast
# it to datetime.datetime correctly.

# Option A: most recent timestep available in the zarr store (no date needed)
time_selection:
most_recent: true

# Option B: explicit individual analysis times (date + hour each)
# time_selection:
# timestamps:
# - "2024-06-01T12:00:00"
# - "2024-06-02T00:00:00"

# Option C: all timesteps in an inclusive date range
# time_selection:
# date_range:
# - "2024-06-01T00:00:00"
# - "2024-06-07T18:00:00"

normalization_method: "standard"

era5:
domain_extent: [-140.0, -60.0, 20.0, 60.0] # [lon_min, lon_max, lat_min, lat_max]
# Use canonical (pressure-level) names for variables that have both surface and
# pressure-level representations. Surface-only variables (e.g.
# "mean_sea_level_pressure") are listed directly.
# The mapping from pressure-level name to surface name is defined in
# fronts.data.config.SURFACE_VARIABLE_MAP and applied automatically when
# "surface" appears in the levels list.
variables:
- "temperature" # surface counterpart: 2m_temperature
- "specific_humidity" # surface counterpart: surface_specific_humidity
- "u_component_of_wind" # surface counterpart: 10m_u_component_of_wind
- "v_component_of_wind" # surface counterpart: 10m_v_component_of_wind
- "mean_sea_level_pressure" # surface-only
# levels may contain "surface" and/or integer hPa values.
# "surface" triggers loading of the surface counterpart for each variable.
levels: ["surface", 1000, 950, 900, 850]
store: "gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3"
chunks:
time: 48
consolidated: true
# Note: era5.years is unused by PredictConfig — time is controlled by time_selection above.
91 changes: 0 additions & 91 deletions convert_front_gml_to_xml.py

This file was deleted.

Loading