Skip to content

Commit

Permalink
Graph config for stretched grid graph (ecmwf#133)
Browse files Browse the repository at this point in the history
* Added stretched grid graph config

* Fix data nodebuilder

* Fix typo

* Running pre-commit hooks

* Updated changelog
  • Loading branch information
havardhhaugen authored Nov 11, 2024
1 parent 58dad76 commit 7cb7680
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Keep it human-readable, your future self will thank you!
- Sub-hour datasets [#63](https://github.com/ecmwf/anemoi-training/pull/63)
- Add synchronisation workflow [#92](https://github.com/ecmwf/anemoi-training/pull/92)
- Feat: Anemoi Profiler compatible with mlflow and using Pytorch (Kineto) Profiler for memory report [38](https://github.com/ecmwf/anemoi-training/pull/38/)

- New stretched grid config added, stretched_grid.yaml [#133](https://github.com/ecmwf/anemoi-training/pull/133)

### Changed
- Renamed frequency keys in callbacks configuration. [#118](https://github.com/ecmwf/anemoi-training/pull/118)
Expand Down
63 changes: 63 additions & 0 deletions src/anemoi/training/config/graph/stretched_grid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Stretched grid graph config intended to be used with a cutout dataset.
# The stretched mesh resolution used here is intended for o96 global resolution with 10km
# limited area resolution.
overwrite: False

data: "data"
hidden: "hidden"

nodes:
data:
node_builder:
_target_: anemoi.graphs.nodes.ZarrDatasetNodes
dataset: ${dataloader.dataset}
attributes:
area_weight:
_target_: anemoi.graphs.nodes.attributes.AreaWeights
norm: unit-max
cutout:
_target_: anemoi.graphs.nodes.attributes.CutOutMask
hidden:
node_builder:
_target_: anemoi.graphs.nodes.StretchedTriNodes
lam_resolution: 8
global_resolution: 5
reference_node_name: ${graph.data}
mask_attr_name: cutout
margin_radius_km: 11
attributes:
area_weights:
_target_: anemoi.graphs.nodes.attributes.AreaWeights
norm: unit-max

edges:
# Encoder
- source_name: ${graph.data}
target_name: ${graph.hidden}
edge_builder:
_target_: anemoi.graphs.edges.KNNEdges
num_nearest_neighbours: 12
attributes: ${graph.attributes.edges}
# Processor
- source_name: ${graph.hidden}
target_name: ${graph.hidden}
edge_builder:
_target_: anemoi.graphs.edges.MultiScaleEdges
x_hops: 1
attributes: ${graph.attributes.edges}
# Decoder
- source_name: ${graph.hidden}
target_name: ${graph.data}
edge_builder:
_target_: anemoi.graphs.edges.KNNEdges
num_nearest_neighbours: 3
attributes: ${graph.attributes.edges}

attributes:
edges:
edge_length:
_target_: anemoi.graphs.edges.attributes.EdgeLength
norm: unit-max
edge_dirs:
_target_: anemoi.graphs.edges.attributes.EdgeDirection
norm: unit-std

0 comments on commit 7cb7680

Please sign in to comment.