Support models with unconnected nodes removed from input (LAM) #95
+29
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for inference from checkpoints created with models where unconnected nodes have been dropped from the input grid, see anemoi-training #171. For the moment the functionality is restricted to inference taking an anemoi-dataset as input.
The indices of those gridpoints in the dataset that remain as input for the model are stored in the checkpoint as the supporting array
grid_indices
. The current implementation is such that if this supporting array is present in the checkpoint then the input is automatically reduced to those points with indices listed ingrid_indices
.A small update of the boundary forcing is also needed, the mask used is now (the negation of) the
output_mask
that can be found in relevant checkpoints.This addresses #87
Update: also added small fix to allow for automatic loading of datasets with more complicated configurations where
sub_dictionary['dataset']
is not necessarily a string, e.g. of the type