Our current config has a few parameters that relate to the data input and output channels that can be easily derived from the new data structure itself.
model:
type: "wxformer"
frames: 1
image_height: 640
image_width: 1280
levels: 16
channels: 4
surface_channels: 1
input_only_channels: 0
output_only_channels: 0 # no diagnostics for speed
Specifically, levels, channels, surface_channels, input_only_channels and output_only_channels can be directly derived from the data portion of the config [prognostic, diagnostic, dynamic_forcing, and static.
I propose removing those entirely from the config and calculating them from the data config within the model init step which should work for both new models and loading in pretrained models.
Furthermore, it would be nice to do this with image_height, image_width and padding too, but that would need to be derived from the data shape of the tensors (and not just the config) and then would also have to make some mathematical assumptions about the padding sizes, but this would require more thought.
Our current config has a few parameters that relate to the data input and output channels that can be easily derived from the new data structure itself.
Specifically,
levels,channels,surface_channels,input_only_channelsandoutput_only_channelscan be directly derived from the data portion of the config [prognostic,diagnostic,dynamic_forcing, andstatic.I propose removing those entirely from the config and calculating them from the data config within the model init step which should work for both new models and loading in pretrained models.
Furthermore, it would be nice to do this with
image_height,image_widthandpaddingtoo, but that would need to be derived from the data shape of the tensors (and not just the config) and then would also have to make some mathematical assumptions about the padding sizes, but this would require more thought.