Interface

class anemoi.models.interface.AnemoiModelInterface(*, config: DotDict, graph_data: HeteroData, statistics: dict, data_indices: dict, metadata: dict, supporting_arrays: dict = None)

Bases: Module

An interface for Anemoi models.

This class is a wrapper around the Anemoi model that includes pre-processing and post-processing steps. It inherits from the PyTorch Module class.

config

Configuration settings for the model.

Type:

DotDict

id

A unique identifier for the model instance.

Type:

str

multi_step

Whether the model uses multi-step input.

Type:

bool

graph_data

Graph data for the model.

Type:

HeteroData

statistics

Statistics for the data.

Type:

dict

metadata

Metadata for the model.

Type:

dict

supporting_arrays

Numpy arraysto store in the checkpoint.

Type:

dict

data_indices

Indices for the data.

Type:

dict

pre_processors

Pre-processing steps to apply to the data before passing it to the model.

Type:

Processors

post_processors

Post-processing steps to apply to the model’s output.

Type:

Processors

model

The underlying Anemoi model.

Type:

AnemoiModelEncProcDec

predict_step(batch: Tensor, model_comm_group: ProcessGroup | None = None, **kwargs) Tensor

Prediction step for the model.

Parameters:

batch (torch.Tensor) – Input batched data.

Returns:

Predicted data.

Return type:

torch.Tensor