This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor Callbacks - Split into seperate files - Use list in config to add callbacks - Split out plotting callbacks config * Refactor rollout (#87) - New rollout central function --------- Co-authored-by: Mario Santa Cruz <[email protected]> Co-authored-by: Sara Hahner <[email protected]>
- Loading branch information
1 parent
6fc2e3b
commit 9ea0390
Showing
24 changed files
with
2,129 additions
and
1,194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/anemoi/training/config/diagnostics/callbacks/pretraining.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Add callbacks here |
4 changes: 4 additions & 0 deletions
4
src/anemoi/training/config/diagnostics/callbacks/rollout_eval.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Add callbacks here | ||
- _target_: anemoi.training.diagnostics.callbacks.evaluation.RolloutEval | ||
rollout: ${dataloader.validation_rollout} | ||
frequency: 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
asynchronous: True # Whether to plot asynchronously | ||
frequency: # Frequency of the plotting | ||
batch: 750 | ||
epoch: 5 | ||
|
||
# Parameters to plot | ||
parameters: | ||
- z_500 | ||
- t_850 | ||
- u_850 | ||
- v_850 | ||
- 2t | ||
- 10u | ||
- 10v | ||
- sp | ||
- tp | ||
- cp | ||
|
||
# Sample index | ||
sample_idx: 0 | ||
|
||
# Precipitation and related fields | ||
precip_and_related_fields: [tp, cp] | ||
|
||
callbacks: | ||
# Add plot callbacks here | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.GraphNodeTrainableFeaturesPlot | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.GraphEdgeTrainableFeaturesPlot | ||
epoch_frequency: 5 | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotLoss | ||
# group parameters by categories when visualizing contributions to the loss | ||
# one-parameter groups are possible to highlight individual parameters | ||
parameter_groups: | ||
moisture: [tp, cp, tcw] | ||
sfc_wind: [10u, 10v] | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotSample | ||
sample_idx: ${diagnostics.plot.sample_idx} | ||
per_sample : 6 | ||
parameters: ${diagnostics.plot.parameters} | ||
#Defining the accumulation levels for precipitation related fields and the colormap | ||
accumulation_levels_plot: [0, 0.05, 0.1, 0.25, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 7, 100] # in mm | ||
cmap_accumulation: ["#ffffff", "#04e9e7", "#019ff4", "#0300f4", "#02fd02", "#01c501", "#008e00", "#fdf802", "#e5bc00", "#fd9500", "#fd0000", "#d40000", "#bc0000", "#f800fd"] | ||
precip_and_related_fields: ${diagnostics.plot.precip_and_related_fields} | ||
|
||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotSpectrum | ||
# batch_frequency: 100 # Override for batch frequency | ||
sample_idx: ${diagnostics.plot.sample_idx} | ||
parameters: | ||
- z_500 | ||
- tp | ||
- 2t | ||
- 10u | ||
- 10v | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotHistogram | ||
sample_idx: ${diagnostics.plot.sample_idx} | ||
precip_and_related_fields: ${diagnostics.plot.precip_and_related_fields} | ||
parameters: | ||
- z_500 | ||
- tp | ||
- 2t | ||
- 10u | ||
- 10v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
callbacks: [] |
68 changes: 68 additions & 0 deletions
68
src/anemoi/training/config/diagnostics/plot/rollout_eval.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
asynchronous: True # Whether to plot asynchronously | ||
frequency: # Frequency of the plotting | ||
batch: 750 | ||
epoch: 5 | ||
|
||
# Parameters to plot | ||
parameters: | ||
- z_500 | ||
- t_850 | ||
- u_850 | ||
- v_850 | ||
- 2t | ||
- 10u | ||
- 10v | ||
- sp | ||
- tp | ||
- cp | ||
|
||
# Sample index | ||
sample_idx: 0 | ||
|
||
# Precipitation and related fields | ||
precip_and_related_fields: [tp, cp] | ||
|
||
callbacks: | ||
# Add plot callbacks here | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.GraphNodeTrainableFeaturesPlot | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.GraphEdgeTrainableFeaturesPlot | ||
epoch_frequency: 5 | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotLoss | ||
# group parameters by categories when visualizing contributions to the loss | ||
# one-parameter groups are possible to highlight individual parameters | ||
parameter_groups: | ||
moisture: [tp, cp, tcw] | ||
sfc_wind: [10u, 10v] | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotSample | ||
sample_idx: ${diagnostics.plot.sample_idx} | ||
per_sample : 6 | ||
parameters: ${diagnostics.plot.parameters} | ||
#Defining the accumulation levels for precipitation related fields and the colormap | ||
accumulation_levels_plot: [0, 0.05, 0.1, 0.25, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 7, 100] # in mm | ||
cmap_accumulation: ["#ffffff", "#04e9e7", "#019ff4", "#0300f4", "#02fd02", "#01c501", "#008e00", "#fdf802", "#e5bc00", "#fd9500", "#fd0000", "#d40000", "#bc0000", "#f800fd"] | ||
precip_and_related_fields: ${diagnostics.plot.precip_and_related_fields} | ||
|
||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotSpectrum | ||
# batch_frequency: 100 # Override for batch frequency | ||
sample_idx: ${diagnostics.plot.sample_idx} | ||
parameters: | ||
- z_500 | ||
- tp | ||
- 2t | ||
- 10u | ||
- 10v | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.PlotHistogram | ||
sample_idx: ${diagnostics.plot.sample_idx} | ||
precip_and_related_fields: ${diagnostics.plot.precip_and_related_fields} | ||
parameters: | ||
- z_500 | ||
- tp | ||
- 2t | ||
- 10u | ||
- 10v | ||
- _target_: anemoi.training.diagnostics.callbacks.plot.LongRolloutPlots | ||
rollout: | ||
- ${dataloader.validation_rollout} | ||
epoch_frequency: 20 | ||
sample_idx: ${diagnostics.plot.sample_idx} | ||
parameters: ${diagnostics.plot.parameters} |
Oops, something went wrong.