Skip to content

Commit

Permalink
chore: new stretched graph config
Browse files Browse the repository at this point in the history
  • Loading branch information
JPXKQX committed Aug 23, 2024
1 parent 3c9e5fe commit 684eb43
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/anemoi/training/config/graph/lam_multi_scale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ nodes:
hidden:
node_builder:
_target_: anemoi.graphs.nodes.LimitedAreaTriNodes # options: ZarrDatasetNodes, NPZFileNodes, TriNodes
resolution: 4 # grid resolution for npz (o32, o48, ...)
reference_node_name: data
resolution: 5 # grid resolution for npz (o32, o48, ...)
reference_node_name: ${graph.data}
mask_attr_name: cutout

edges:
Expand Down
60 changes: 60 additions & 0 deletions src/anemoi/training/config/graph/stretched_multi_scale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
overwrite: True

data: "data"
hidden: "hidden"

nodes:
# Data nodes
data:
node_builder:
_target_: anemoi.graphs.nodes.CutOutZarrDatasetNodes
lam_dataset: ${hardware.paths.data}/${hardware.files.dataset}
forcing_dataset: ${hardware.paths.data}/${hardware.files.forcing_dataset}
thinning: 25
attributes: ${graph.attributes.nodes}
# Hidden nodes
hidden:
node_builder:
_target_: anemoi.graphs.nodes.StretchedTriNodes
lam_resolution: 5
global_resolution: 3
reference_node_name: ${graph.data}
mask_attr_name: cutout

edges:
# Encoder configuration
- source_name: ${graph.data}
target_name: ${graph.hidden}
edge_builder:
_target_: anemoi.graphs.edges.CutOffEdges # options: KNNEdges, CutOffEdges
cutoff_factor: 0.6 # only for cutoff method
attributes: ${graph.attributes.edges}
- source_name: ${graph.hidden}
# Processor configuration
target_name: ${graph.hidden}
edge_builder:
_target_: anemoi.graphs.edges.MultiScaleEdges
x_hops: 1
attributes: ${graph.attributes.edges}
- source_name: ${graph.hidden}
# Decoder configuration
target_name: ${graph.data}
edge_builder:
_target_: anemoi.graphs.edges.KNNEdges # options: KNNEdges, CutOffEdges
num_nearest_neighbours: 3 # only for knn method
attributes: ${graph.attributes.edges}


attributes:
nodes:
area_weight:
_target_: anemoi.graphs.nodes.attributes.AreaWeights # options: Area, Uniform
#norm: unit-max # options: l1, l2, unit-max, unit-sum, unit-std
edges:
edge_length:
_target_: anemoi.graphs.edges.attributes.EdgeLength
norm: unit-std
edge_dirs:
_target_: anemoi.graphs.edges.attributes.EdgeDirection
norm: unit-std
45 changes: 45 additions & 0 deletions src/anemoi/training/config/limited_area_stretched.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
defaults:
- data: zarr
- dataloader: native_grid
- diagnostics: eval_rollout
- hardware: example
- graph: stretched_multi_scale
- model: gnn
- training: default
- _self_


### This file is for local experimentation.
## When you commit your changes, assign the new features and keywords
## to the correct defaults.
# For example to change from default GPU count:
# hardware:
# num_gpus_per_node: 1

data:
resolution: ??? # must match the resolution of the regional dataset
forcing: ???
diagnostic: []
normalizer:
max: []
none: ???
diagnostics:
plot:
enabled: False
hardware:
files:
graph: ???
model:
num_channels: 128
dataloader:
dataset:
cutout:
- dataset: ${hardware.paths.data}/${hardware.files.dataset}
thinning: ${graph.nodes.data.node_builder.thinning}
- dataset: ${hardware.paths.data}/${hardware.files.forcing_dataset}
adjust: all
limit_batches:
training: 100
validation: 100
training:
max_epochs: 5

0 comments on commit 684eb43

Please sign in to comment.