Schemas
This module defines pydantic schemas, which are used to validate the configuration before a training run is started. The top-level config yaml matches the BaseSchema.
The below schemas are organised below identically to the training config files,
Data
- class anemoi.training.schemas.data.DatasetDataSchema(*, forcing: list[str] = <factory>, diagnostic: list[str] = <factory>, target: list[str] | None = None, processors: dict[str, ~anemoi.models.schemas.data_processor.PreprocessorSchema])
Bases:
BaseModelA class used to represent the configuration of a single dataset.
- forcing: list[str]
Features that are not part of the forecast state but are used as forcing to generate the forecast state.
- diagnostic: list[str]
Features that are only part of the forecast state and are not used as an input to the model.
- target: list[str] | None
prognostic = diagnostic - forcing.union(target).
- Type:
Features used to compute the loss against forecasted variables. Cannot be prognostic or diagnostic, can have the same name as forcing variables but have a different role. Such that
- processors: dict[str, PreprocessorSchema]
Layers of model performing computation on latent space. Processors including imputers and normalizers are applied in order of definition. (single dataset mode)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.data.DataSchema(*, format: str, frequency: str | None = None, datasets: dict[str, DatasetDataSchema] | None = None, num_features: int | None)
Bases:
BaseModelA class used to represent the overall configuration of the dataset(s).
- datasets
“Dictionary mapping dataset names to their configurations.”
- Type:
dict[str, DatasetDataSchema] | None
- num_features
The number of features in the forecast state. To be set in the code.
- Type:
int, optional
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- frequency: str | None
Time frequency requested from the dataset. Must be null when using trajectory (forecast) datasets.
- datasets: dict[str, DatasetDataSchema] | None
Dictionary mapping dataset names to their configurations.
Dataloader
Diagnostics
- class anemoi.training.schemas.diagnostics.GraphTrainableFeaturesPlotSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.plot.GraphTrainableFeaturesPlot'], dataset_names: list[str], every_n_epochs: int | None)
Bases:
BaseModel- target_: Literal['anemoi.training.diagnostics.callbacks.plot.GraphTrainableFeaturesPlot']
GraphTrainableFeaturesPlot object from anemoi training diagnostics callbacks.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.FocusAreaSchema(*, name: str | None = None, mask_attr_name: str | None = None, latlon_bbox: Annotated[list[float] | None, MinLen(min_length=4), MaxLen(max_length=4)] = None)
Bases:
BaseModel- latlon_bbox: list[float] | None
Latitude and longitude bounds as [lat_min, lon_min, lat_max, lon_max].
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.PlotLossSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotLoss'], dataset_names: list[str], parameter_groups: dict[str, list[str]], every_n_batches: int | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotLoss']
PlotLoss object from anemoi training diagnostics callbacks.
- parameter_groups: dict[str, list[str]]
Dictionary with parameter groups with parameter names as key.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.MatplotlibColormapSchema(*, _target_: Literal['anemoi.training.utils.custom_colormaps.MatplotlibColormap'], name: str, variables: list[str] | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.utils.custom_colormaps.MatplotlibColormap']
CustomColormap object from anemoi training utils.
- variables: list[str] | None
A list of strings representing the variables for which the colormap is used, by default None.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.MatplotlibColormapClevelsSchema(*, _target_: Literal['anemoi.training.utils.custom_colormaps.MatplotlibColormapClevels'], clevels: list, variables: list[str] | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.utils.custom_colormaps.MatplotlibColormapClevels']
CustomColormap object from anemoi training utils.
- variables: list[str] | None
A list of strings representing the variables for which the colormap is used, by default None.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.DistinctipyColormapSchema(*, _target_: Literal['anemoi.training.utils.custom_colormaps.DistinctipyColormap'], n_colors: int, variables: list[str] | None = None, colorblind_type: str | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.utils.custom_colormaps.DistinctipyColormap']
CustomColormap object from anemoi training utils.
- variables: list[str] | None
A list of strings representing the variables for which the colormap is used, by default None.
- colorblind_type: str | None
The type of colorblindness to simulate. If None, the default colorblindness from distinctipy is applied.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.PlotSampleSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotSample'], dataset_names: list[str], sample_idx: int, parameters: list[str], accumulation_levels_plot: list[float], precip_and_related_fields: list[str] | None = None, per_sample: int, every_n_batches: int | None = None, colormaps: dict[str, Annotated[MatplotlibColormapSchema | MatplotlibColormapClevelsSchema | DistinctipyColormapSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]] | None = None, focus_area: FocusAreaSchema | None = None, prediction_label: str = 'pred', auxiliary_label: str = 'corrupted targets')
Bases:
BaseModel- target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotSample']
PlotSample object from anemoi training diagnostics callbacks.
List of precipitation related fields, by default None.
- colormaps: dict[str, Annotated[MatplotlibColormapSchema | MatplotlibColormapClevelsSchema | DistinctipyColormapSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]] | None
List of colormaps to use, by default None.
- focus_area: FocusAreaSchema | None
Region of interest to restrict plots to, specified by ‘mask_attr_name’ or ‘latlon_bbox’
- auxiliary_label: str
Label used for the optional panel that shows the corrupted target seen by the model.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.PlotSpectrumSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotSpectrum'], dataset_names: list[str], sample_idx: int, parameters: list[str], every_n_batches: int | None = None, focus_area: FocusAreaSchema | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotSpectrum']
PlotSpectrum object from anemoi training diagnostics callbacks.
- focus_area: FocusAreaSchema | None
Region of interest to restrict plots to, specified by ‘mask_attr_name’ or ‘latlon_bbox’
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.PlotHistogramSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotHistogram'], dataset_names: list[str], sample_idx: int, parameters: list[str], precip_and_related_fields: list[str] | None = None, every_n_batches: int | None = None, focus_area: FocusAreaSchema | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotHistogram']
PlotHistogram object from anemoi training diagnostics callbacks.
List of precipitation related fields, by default None.
- focus_area: FocusAreaSchema | None
Region of interest to restrict plots to, specified by ‘mask_attr_name’ or ‘latlon_bbox’
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.PlotEnsSampleSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotEnsSample'], dataset_names: list[str], sample_idx: int, parameters: list[str], accumulation_levels_plot: list[float], precip_and_related_fields: list[str] | None = None, per_sample: int, every_n_batches: int | None = None, colormaps: dict[str, Annotated[MatplotlibColormapSchema | MatplotlibColormapClevelsSchema | DistinctipyColormapSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]] | None = None, members: list[int] | int | None = None, focus_area: FocusAreaSchema | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.diagnostics.callbacks.plot.PlotEnsSample']
PlotEnsSample object from anemoi training diagnostics callbacks.
List of precipitation related fields, by default None.
- colormaps: dict[str, Annotated[MatplotlibColormapSchema | MatplotlibColormapClevelsSchema | DistinctipyColormapSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]] | None
List of colormaps to use, by default None.
- focus_area: FocusAreaSchema | None
Region of interest to restrict plots to, specified by ‘mask_attr_name’ or ‘latlon_bbox’
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.PlottingFrequency(*, batch: Annotated[int, Gt(gt=0)], epoch: Annotated[int, Gt(gt=0)])
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.PlotSchema(*, asynchronous: bool, datashader: bool, projection_kind: str = 'equirectangular', callbacks: list[Annotated[GraphTrainableFeaturesPlotSchema | PlotLossSchema | PlotSampleSchema | PlotSpectrumSchema | PlotHistogramSchema | PlotEnsSampleSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]], colormaps: dict | None = None, precip_and_related_fields: list[str] | None = None, focus_areas: dict | None = None, datasets_to_plot: list[str] | None = None)
Bases:
BaseModel- projection_kind: str
Map projection for diagnostics plots.
Built-in options:
'equirectangular'(no cartopy required) and'lambert_conformal'(auto-fitted to the data domain; requires cartopy). Anycartopy.crsclass name in snake_case is also accepted (e.g.'robinson','mollweide','orthographic'); these require cartopy and are instantiated with default constructor arguments (e.g.'orthographic'centres on longitude/latitude 0). If you need non-default parameters, use'lambert_conformal'(auto-fitted to the data domain) or subclassMapProjection. Must be'equirectangular'whendatashaderisTrue.
- callbacks: list[Annotated[GraphTrainableFeaturesPlotSchema | PlotLossSchema | PlotSampleSchema | PlotSpectrumSchema | PlotHistogramSchema | PlotEnsSampleSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]]
List of plotting functions to call.
- colormaps: dict | None
Variable-specific colormaps keyed by ‘default’, ‘error’, or variable name group.
Names of precipitation and related fields that use a special colormap.
- focus_areas: dict | None
Named spatial focus areas (lat/lon bounding boxes or node attribute masks).
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.TimeLimitSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.stopping.TimeLimit'], limit: int | str, record_file: str | None = None)
Bases:
BaseModel- target_: Literal['anemoi.training.diagnostics.callbacks.stopping.TimeLimit']
TimeLimit object from anemoi training diagnostics callbacks.
- limit: int | str
Time limit, if int, assumed to be hours, otherwise must be a string with units (e.g. ‘1h’, ‘30m’).
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.EarlyStoppingSchema(*, _target_: Literal['anemoi.training.diagnostics.callbacks.stopping.EarlyStopping'], monitor: str, min_delta: float = 0.0, patience: int = 3, verbose: bool = False, mode: Literal['min', 'max'] = 'min', strict: bool = True, check_finite: bool = True, stopping_threshold: float | None = None, divergence_threshold: float | None = None, check_on_train_epoch_end: bool | None = None)
Bases:
BaseModel- mode: Literal['min', 'max']
One of {‘min’, ‘max’}, changes if minimisation or maximimisation of the metric is ‘good’.
- stopping_threshold: float | None
Stop training immediately once the monitored quantity reaches this threshold.
- divergence_threshold: float | None
Stop training as soon as the monitored quantity becomes worse than this threshold..
- check_on_train_epoch_end: bool | None
Whether to check the stopping criteria at the end of each training epoch.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.Debug(*, anomaly_detection: bool)
Bases:
BaseModel- anomaly_detection: bool
Activate anomaly detection. This will detect and trace back NaNs/Infs, but slow down training.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.CheckpointSchema(*, save_frequency: int | None, num_models_saved: int)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.WandbSchema(*, _target_: Literal['pytorch_lightning.loggers.wandb.WandbLogger'] = 'pytorch_lightning.loggers.wandb.WandbLogger', enabled: bool, offline: bool, log_model: bool | Literal['all'], project: str, gradients: bool, parameters: bool, entity: str | None = None, interval: Annotated[int, Gt(gt=0)] | None = 100)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- log_model: bool | Literal['all']
Log checkpoints created by ModelCheckpoint as W&B artifacts. If True, checkpoints are logged at the end of training. If ‘all’, checkpoints are logged during training.
- class anemoi.training.schemas.diagnostics.MlflowSchema(*, _target_: ~typing.Literal['anemoi.training.diagnostics.mlflow.logger.AnemoiMLflowLogger'] = 'anemoi.training.diagnostics.mlflow.logger.AnemoiMLflowLogger', enabled: bool, offline: bool, authentication: bool, log_model: bool | ~typing.Literal['all'] | None = None, tracking_uri: str | None = None, experiment_name: str, project_name: str, system: bool, terminal: bool, run_name: str | None, prefix: str = '', log_hyperparams: bool = True, on_resume_create_child: bool, expand_hyperparams: list[str] = <factory>, http_max_retries: ~typing.Annotated[int, ~annotated_types.Gt(gt=0)], max_params_length: int = 2000, save_dir: str | None = None)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- log_model: bool | Literal['all'] | None
Log checkpoints created by ModelCheckpoint as MLFlow artifacts. If True, checkpoints are logged at the end of training. If ‘all’, checkpoints are logged during training.
- expand_hyperparams: list[str]
Keys to expand within params. Any key being expanded will have lists converted according to expand_iterables.
- class anemoi.training.schemas.diagnostics.AzureMlflowSchema(*, _target_: ~typing.Literal['anemoi.training.diagnostics.mlflow.azureml.AnemoiAzureMLflowLogger'], enabled: bool, offline: ~typing.Literal[False], authentication: bool, log_model: bool | ~typing.Literal['all'] | None = None, tracking_uri: str | None = None, experiment_name: str, project_name: str, system: bool, terminal: ~typing.Literal[False], run_name: str | None, prefix: str = '', log_hyperparams: bool = True, on_resume_create_child: bool, expand_hyperparams: list[str] = <factory>, http_max_retries: ~typing.Annotated[int, ~annotated_types.Gt(gt=0)], max_params_length: int = 2000, save_dir: str | None = None, identity: str | None = None, resource_group: str | None = None, workspace_name: str | None = None, subscription_id: str | None = None, azure_log_level: str = 'WARNING')
Bases:
MlflowSchema- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.LoggingSchema(*, wandb: WandbSchema | None = None, mlflow: MlflowSchema | AzureMlflowSchema | None = None, interval: Annotated[int, Gt(gt=0)])
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- wandb: WandbSchema | None
W&B logging schema.
- mlflow: Annotated[MlflowSchema | AzureMlflowSchema | None, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]
MLflow logging schema.
- class anemoi.training.schemas.diagnostics.MemorySchema(*, enabled: bool, steps: Annotated[int, Gt(gt=0)], warmup: Annotated[int, Ge(ge=0)], extra_plots: bool, trace_rank0_only: bool)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- warmup: Annotated[int, Ge(ge=0)]
Number of step to discard before the profiler starts to record traces. Default to 2.
- class anemoi.training.schemas.diagnostics.Snapshot(*, enabled: bool, steps: Annotated[int, Gt(gt=0)], warmup: Annotated[int, Ge(ge=0)])
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.Profiling(*, enabled: bool, verbose: bool | None = None)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.BenchmarkProfilerSchema(*, memory: MemorySchema = <factory>, time: Profiling = <factory>, speed: Profiling = <factory>, system: Profiling = <factory>, model_summary: Profiling = <factory>, snapshot: Snapshot = <factory>)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- memory: MemorySchema
Schema for memory report containing metrics associated with CPU and GPU memory allocation.
- class anemoi.training.schemas.diagnostics.ProgressBarSchema(*, _target_: Literal['pytorch_lightning.callbacks.TQDMProgressBar', 'pytorch_lightning.callbacks.RichProgressBar', 'anemoi.training.diagnostics.profilers.ProfilerProgressBar'], refresh_rate: Annotated[int, Gt(gt=0)] = 1)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.diagnostics.DiagnosticsSchema(*, plot: PlotSchema | None = None, callbacks: list = <factory>, benchmark_profiler: BenchmarkProfilerSchema, debug: Debug, log: LoggingSchema, enable_progress_bar: bool, progress_bar: ProgressBarSchema | None = None, print_memory_summary: bool, enable_checkpointing: bool, checkpoint: dict[str, ~anemoi.training.schemas.diagnostics.CheckpointSchema]=<factory>, check_val_every_n_epoch: Annotated[int, ~annotated_types.Gt(gt=0)] = 1)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- plot: PlotSchema | None
Plot schema.
- benchmark_profiler: BenchmarkProfilerSchema
Benchmark profiler schema for profile command.
- log: LoggingSchema
Log schema.
- progress_bar: ProgressBarSchema | None
Progress bar schema.
- checkpoint: dict[str, CheckpointSchema]
Checkpoint schema for defined frequency (every_n_minutes, every_n_epochs, …).
System
- class anemoi.training.schemas.system.HardwareSchema(*, accelerator: Annotated[str, ~pydantic.functional_validators.AfterValidator(func=functools.partial(<function allowed_values at 0x7cbeaedfe700>, values=['cpu', 'gpu', 'auto', 'cuda', 'tpu']))]='cuda', num_gpus_per_node: Annotated[int, ~annotated_types.Ge(ge=0)] = 1, num_nodes: Annotated[int, ~annotated_types.Ge(ge=0)] = 1, num_gpus_per_model: Annotated[int, ~annotated_types.Ge(ge=0)] = 1, num_gpus_per_ensemble: Annotated[int, ~annotated_types.Ge(ge=0)] = 1)
Bases:
BaseModel- accelerator: partial(<function allowed_values at 0x7cbeaedfe700>, values=['cpu', 'gpu', 'auto', 'cuda', 'tpu']))]
Accelerator to use for training.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.system.InputSchema(*, dataset: Path | dict[str, Path] | None = None, graph: Path | None = None, truncation: Path | None = None, truncation_inv: Path | None = None, loss_matrices_path: Path | None = None, warm_start: Path | None = None)
Bases:
BaseModel- loss_matrices_path: Path | None
Path to the directory containing smoothing matrices for the multiscale loss
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.system.CheckpointsSchema(*, root: Path, every_n_epochs: str = 'anemoi-by_epoch-epoch_{epoch:03d}-step_{step:06d}', every_n_train_steps: str = 'anemoi-by_step-epoch_{epoch:03d}-step_{step:06d}', every_n_minutes: str = 'anemoi-by_time-epoch_{epoch:03d}-step_{step:06d}')
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.system.Logs(*, root: Path, wandb: Path | None = None, mlflow: Path | None = None, tensorboard: Path | None = None)
Bases:
BaseModel- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.training.schemas.system.OutputSchema(*, root: Path | None = None, logs: Logs | None = None, checkpoints: CheckpointsSchema = <factory>, plots: Path | None = None, profiler: Path | None)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- checkpoints: CheckpointsSchema
Paths to the checkpoints.
- class anemoi.training.schemas.system.SystemSchema(*, hardware: HardwareSchema, input: InputSchema, output: OutputSchema)
Bases:
BaseModel- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- hardware: HardwareSchema
Specification of hardware and compute resources available including the number of nodes, GPUs, and accelerator.
- input: InputSchema
Definitions of specific input and output artifacts used relative to the directories defined in output.
- output: OutputSchema
High-level directory structure describing where data is read from.
Graph
- class anemoi.graphs.schemas.base_graph.NodeSchema(*, node_builder: AnemoiDatasetNodeSchema | NPZnodeSchema | TextNodeSchema | ICONMeshNodeSchema | LimitedAreaNPZFileNodesSchema | ReducedGaussianGridNodeSchema | IcosahedralandHealPixNodeSchema | LimitedAreaIcosahedralandHealPixNodeSchema | StretchedIcosahdralNodeSchema, attributes: dict[str, PlanarAreaWeightSchema | MaskedPlanarAreaWeightsSchema | SphericalAreaWeightSchema | CutOutMaskSchema | GridsMaskSchema | NonmissingAnemoiDatasetVariableSchema | BooleanOperationSchema] | None = None)
Bases:
BaseModel- node_builder: Annotated[AnemoiDatasetNodeSchema | NPZnodeSchema | TextNodeSchema | ICONMeshNodeSchema | LimitedAreaNPZFileNodesSchema | ReducedGaussianGridNodeSchema | IcosahedralandHealPixNodeSchema | LimitedAreaIcosahedralandHealPixNodeSchema | StretchedIcosahdralNodeSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]
Node builder schema.
- attributes: dict[str, PlanarAreaWeightSchema | MaskedPlanarAreaWeightsSchema | SphericalAreaWeightSchema | CutOutMaskSchema | GridsMaskSchema | NonmissingAnemoiDatasetVariableSchema | BooleanOperationSchema] | None
Dictionary of attributes with names as keys and anemoi.graphs.nodes.attributes objects as values.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.graphs.schemas.base_graph.EdgeSchema(*, source_name: str, target_name: str, edge_builders: list[Annotated[KNNEdgeSchema | CutoffEdgeSchema | MultiScaleEdgeSchema | HEALPixMultiScaleEdgesSchema | ICONTopologicalEdgeSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]], attributes: dict[str, BaseEdgeAttributeSchema | EdgeAttributeFromNodeSchema | DirectionalHarmonicsSchema | RadialBasisFeaturesSchema])
Bases:
BaseModel- edge_builders: list[Annotated[KNNEdgeSchema | CutoffEdgeSchema | MultiScaleEdgeSchema | HEALPixMultiScaleEdgesSchema | ICONTopologicalEdgeSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]]
Edge builder schema.
- attributes: dict[str, BaseEdgeAttributeSchema | EdgeAttributeFromNodeSchema | DirectionalHarmonicsSchema | RadialBasisFeaturesSchema]
Dictionary of attributes with names as keys and anemoi.graphs.edges.attributes objects as values.
- model_config = {'extra': 'forbid', 'use_attribute_docstrings': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class anemoi.graphs.schemas.base_graph.BaseGraphSchema(*, nodes: dict[str, ~anemoi.graphs.schemas.base_graph.NodeSchema] | None=None, edges: list[EdgeSchema] | None = None, overwrite: bool, post_processors: list[~types.Annotated[~anemoi.graphs.schemas.post_processors.RemoveUnconnectedNodesSchema | ~anemoi.graphs.schemas.post_processors.SubsetNodesInAreaSchema | ~anemoi.graphs.schemas.post_processors.RestrictEdgeLengthSchema | ~anemoi.graphs.schemas.post_processors.RemoveSelfEdgesSchema | ~anemoi.graphs.schemas.post_processors.SortEdgeIndexSchema, FieldInfo(annotation=NoneType, required=True, discriminator='target_')]] = <factory>)
Bases:
BaseModel- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nodes: dict[str, NodeSchema] | None
Nodes schema for all types of nodes (ex. data, hidden).
- edges: list[EdgeSchema] | None
List of edges schema.